diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 16:37:42 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 17:09:51 -0800 |
| commit | bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch) | |
| tree | 01fdd9d27f1b272bef0127966e08eac44d134d0a /net/ipv4 | |
| parent | e19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff) | |
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using
git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'
to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.
Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.
For the same reason the 'flex' versions will be done as a separate
conversion.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/ipv4')
| -rw-r--r-- | net/ipv4/ah4.c | 2 | ||||
| -rw-r--r-- | net/ipv4/devinet.c | 2 | ||||
| -rw-r--r-- | net/ipv4/fou_core.c | 2 | ||||
| -rw-r--r-- | net/ipv4/inet_diag.c | 2 | ||||
| -rw-r--r-- | net/ipv4/inet_fragment.c | 2 | ||||
| -rw-r--r-- | net/ipv4/inet_hashtables.c | 2 | ||||
| -rw-r--r-- | net/ipv4/ip_sockglue.c | 2 | ||||
| -rw-r--r-- | net/ipv4/ipconfig.c | 2 | ||||
| -rw-r--r-- | net/ipv4/ipmr_base.c | 2 | ||||
| -rw-r--r-- | net/ipv4/metrics.c | 2 | ||||
| -rw-r--r-- | net/ipv4/nexthop.c | 8 | ||||
| -rw-r--r-- | net/ipv4/route.c | 4 | ||||
| -rw-r--r-- | net/ipv4/tcp_fastopen.c | 2 | ||||
| -rw-r--r-- | net/ipv4/udp.c | 2 | ||||
| -rw-r--r-- | net/ipv4/udp_tunnel_nic.c | 2 |
15 files changed, 19 insertions, 19 deletions
diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c index f4a207c7cfc6..5fb812443a08 100644 --- a/net/ipv4/ah4.c +++ b/net/ipv4/ah4.c @@ -484,7 +484,7 @@ static int ah_init_state(struct xfrm_state *x, struct netlink_ext_ack *extack) goto error; } - ahp = kzalloc_obj(*ahp, GFP_KERNEL); + ahp = kzalloc_obj(*ahp); if (!ahp) return -ENOMEM; diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 9fd41dfbe788..8f4190c7c9ab 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -270,7 +270,7 @@ static struct in_device *inetdev_init(struct net_device *dev) ASSERT_RTNL(); - in_dev = kzalloc_obj(*in_dev, GFP_KERNEL); + in_dev = kzalloc_obj(*in_dev); if (!in_dev) goto out; memcpy(&in_dev->cnf, dev_net(dev)->ipv4.devconf_dflt, diff --git a/net/ipv4/fou_core.c b/net/ipv4/fou_core.c index 885f3b06f6e9..3baaa4df7e42 100644 --- a/net/ipv4/fou_core.c +++ b/net/ipv4/fou_core.c @@ -581,7 +581,7 @@ static int fou_create(struct net *net, struct fou_cfg *cfg, goto error; /* Allocate FOU port structure */ - fou = kzalloc_obj(*fou, GFP_KERNEL); + fou = kzalloc_obj(*fou); if (!fou) { err = -ENOMEM; goto error; diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 89f99c7ee69e..9d215485b5c7 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -845,7 +845,7 @@ static int __inet_diag_dump_start(struct netlink_callback *cb, int hdrlen) struct nlattr *nla; int err; - cb_data = kzalloc_obj(*cb_data, GFP_KERNEL); + cb_data = kzalloc_obj(*cb_data); if (!cb_data) return -ENOMEM; diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c index b006606ebb1d..393770920abd 100644 --- a/net/ipv4/inet_fragment.c +++ b/net/ipv4/inet_fragment.c @@ -188,7 +188,7 @@ static void fqdir_work_fn(struct work_struct *work) int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net) { - struct fqdir *fqdir = kzalloc_obj(*fqdir, GFP_KERNEL); + struct fqdir *fqdir = kzalloc_obj(*fqdir); int res; if (!fqdir) diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c index 50bf4ec8213a..fca980772c81 100644 --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c @@ -1284,7 +1284,7 @@ void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name, int inet_hashinfo2_init_mod(struct inet_hashinfo *h) { - h->lhash2 = kmalloc_objs(*h->lhash2, INET_LHTABLE_SIZE, GFP_KERNEL); + h->lhash2 = kmalloc_objs(*h->lhash2, INET_LHTABLE_SIZE); if (!h->lhash2) return -ENOMEM; diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index d09377780942..697e18242d6c 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -350,7 +350,7 @@ int ip_ra_control(struct sock *sk, unsigned char on, if (sk->sk_type != SOCK_RAW || inet_sk(sk)->inet_num == IPPROTO_RAW) return -EINVAL; - new_ra = on ? kmalloc_obj(*new_ra, GFP_KERNEL) : NULL; + new_ra = on ? kmalloc_obj(*new_ra) : NULL; if (on && !new_ra) return -ENOMEM; diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 5dcac1fb4209..a35ffedacc7c 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -244,7 +244,7 @@ static int __init ic_open_devs(void) dev->name); continue; } - if (!(d = kmalloc_obj(struct ic_device, GFP_KERNEL))) { + if (!(d = kmalloc_obj(struct ic_device))) { rtnl_unlock(); return -ENOMEM; } diff --git a/net/ipv4/ipmr_base.c b/net/ipv4/ipmr_base.c index 77b7717b9c14..2d62526406ca 100644 --- a/net/ipv4/ipmr_base.c +++ b/net/ipv4/ipmr_base.c @@ -38,7 +38,7 @@ mr_table_alloc(struct net *net, u32 id, struct mr_table *mrt; int err; - mrt = kzalloc_obj(*mrt, GFP_KERNEL); + mrt = kzalloc_obj(*mrt); if (!mrt) return ERR_PTR(-ENOMEM); mrt->id = id; diff --git a/net/ipv4/metrics.c b/net/ipv4/metrics.c index 8b88d674a1ea..c1463add48c4 100644 --- a/net/ipv4/metrics.c +++ b/net/ipv4/metrics.c @@ -73,7 +73,7 @@ struct dst_metrics *ip_fib_metrics_init(struct nlattr *fc_mx, if (!fc_mx) return (struct dst_metrics *)&dst_default_metrics; - fib_metrics = kzalloc_obj(*fib_metrics, GFP_KERNEL); + fib_metrics = kzalloc_obj(*fib_metrics); if (unlikely(!fib_metrics)) return ERR_PTR(-ENOMEM); diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c index 36b52a92e999..b9873370c69e 100644 --- a/net/ipv4/nexthop.c +++ b/net/ipv4/nexthop.c @@ -116,7 +116,7 @@ static int nh_notifier_single_info_init(struct nh_notifier_info *info, struct nh_info *nhi = rtnl_dereference(nh->nh_info); info->type = NH_NOTIFIER_INFO_TYPE_SINGLE; - info->nh = kzalloc_obj(*info->nh, GFP_KERNEL); + info->nh = kzalloc_obj(*info->nh); if (!info->nh) return -ENOMEM; @@ -318,7 +318,7 @@ static int nh_notifier_res_bucket_info_init(struct nh_notifier_info *info, return err; info->type = NH_NOTIFIER_INFO_TYPE_RES_BUCKET; - info->nh_res_bucket = kzalloc_obj(*info->nh_res_bucket, GFP_KERNEL); + info->nh_res_bucket = kzalloc_obj(*info->nh_res_bucket); if (!info->nh_res_bucket) return -ENOMEM; @@ -534,7 +534,7 @@ static struct nexthop *nexthop_alloc(void) { struct nexthop *nh; - nh = kzalloc_obj(struct nexthop, GFP_KERNEL); + nh = kzalloc_obj(struct nexthop); if (nh) { INIT_LIST_HEAD(&nh->fi_list); INIT_LIST_HEAD(&nh->f6i_list); @@ -2895,7 +2895,7 @@ static struct nexthop *nexthop_create(struct net *net, struct nh_config *cfg, if (!nh) return ERR_PTR(-ENOMEM); - nhi = kzalloc_obj(*nhi, GFP_KERNEL); + nhi = kzalloc_obj(*nhi); if (!nhi) { kfree(nh); return ERR_PTR(-ENOMEM); diff --git a/net/ipv4/route.c b/net/ipv4/route.c index c75b92f60742..463236e0dc2d 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -315,7 +315,7 @@ static int rt_acct_proc_show(struct seq_file *m, void *v) struct ip_rt_acct *dst, *src; unsigned int i, j; - dst = kzalloc_objs(struct ip_rt_acct, 256, GFP_KERNEL); + dst = kzalloc_objs(struct ip_rt_acct, 256); if (!dst) return -ENOMEM; @@ -3687,7 +3687,7 @@ static __net_initdata struct pernet_operations rt_genid_ops = { static int __net_init ipv4_inetpeer_init(struct net *net) { - struct inet_peer_base *bp = kmalloc_obj(*bp, GFP_KERNEL); + struct inet_peer_base *bp = kmalloc_obj(*bp); if (!bp) return -ENOMEM; diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c index b4309dc4b9c5..1b7ba2cf3efe 100644 --- a/net/ipv4/tcp_fastopen.c +++ b/net/ipv4/tcp_fastopen.c @@ -149,7 +149,7 @@ int tcp_fastopen_reset_cipher(struct net *net, struct sock *sk, struct fastopen_queue *q; int err = 0; - ctx = kmalloc_obj(*ctx, GFP_KERNEL); + ctx = kmalloc_obj(*ctx); if (!ctx) { err = -ENOMEM; goto out; diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 5fcf81a833e8..6c6b68a66dcd 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -3859,7 +3859,7 @@ static struct udp_table __net_init *udp_pernet_table_alloc(unsigned int hash_ent unsigned int slot_size; int i; - udptable = kmalloc_obj(*udptable, GFP_KERNEL); + udptable = kmalloc_obj(*udptable); if (!udptable) goto out; diff --git a/net/ipv4/udp_tunnel_nic.c b/net/ipv4/udp_tunnel_nic.c index ae674e3ed9b8..75d9b6d3f51a 100644 --- a/net/ipv4/udp_tunnel_nic.c +++ b/net/ipv4/udp_tunnel_nic.c @@ -821,7 +821,7 @@ static int udp_tunnel_nic_register(struct net_device *dev) /* Create UDP tunnel state structures */ if (info->shared) { - node = kzalloc_obj(*node, GFP_KERNEL); + node = kzalloc_obj(*node); if (!node) return -ENOMEM; |
