summaryrefslogtreecommitdiff
path: root/drivers/net/netdevsim
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 16:37:42 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 17:09:51 -0800
commitbf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch)
tree01fdd9d27f1b272bef0127966e08eac44d134d0a /drivers/net/netdevsim
parente19e1b480ac73c3e62ffebbca1174f0f511f43e7 (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 'drivers/net/netdevsim')
-rw-r--r--drivers/net/netdevsim/bpf.c2
-rw-r--r--drivers/net/netdevsim/bus.c2
-rw-r--r--drivers/net/netdevsim/dev.c6
-rw-r--r--drivers/net/netdevsim/fib.c10
-rw-r--r--drivers/net/netdevsim/hwstats.c2
-rw-r--r--drivers/net/netdevsim/psample.c2
6 files changed, 12 insertions, 12 deletions
diff --git a/drivers/net/netdevsim/bpf.c b/drivers/net/netdevsim/bpf.c
index badf08add94f..8eebcc933ddb 100644
--- a/drivers/net/netdevsim/bpf.c
+++ b/drivers/net/netdevsim/bpf.c
@@ -222,7 +222,7 @@ static int nsim_bpf_create_prog(struct nsim_dev *nsim_dev,
char name[16];
int ret;
- state = kzalloc_obj(*state, GFP_KERNEL);
+ state = kzalloc_obj(*state);
if (!state)
return -ENOMEM;
diff --git a/drivers/net/netdevsim/bus.c b/drivers/net/netdevsim/bus.c
index 8de96fe6c02a..f85b1c261dfb 100644
--- a/drivers/net/netdevsim/bus.c
+++ b/drivers/net/netdevsim/bus.c
@@ -451,7 +451,7 @@ nsim_bus_dev_new(unsigned int id, unsigned int port_count, unsigned int num_queu
struct nsim_bus_dev *nsim_bus_dev;
int err;
- nsim_bus_dev = kzalloc_obj(*nsim_bus_dev, GFP_KERNEL);
+ nsim_bus_dev = kzalloc_obj(*nsim_bus_dev);
if (!nsim_bus_dev)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
index a227c0b9fe4c..bc13df81bfa3 100644
--- a/drivers/net/netdevsim/dev.c
+++ b/drivers/net/netdevsim/dev.c
@@ -935,7 +935,7 @@ static int nsim_dev_traps_init(struct devlink *devlink)
struct nsim_trap_data *nsim_trap_data;
int err;
- nsim_trap_data = kzalloc_obj(*nsim_trap_data, GFP_KERNEL);
+ nsim_trap_data = kzalloc_obj(*nsim_trap_data);
if (!nsim_trap_data)
return -ENOMEM;
@@ -1348,7 +1348,7 @@ static int nsim_rate_node_new(struct devlink_rate *node, void **priv,
return -EOPNOTSUPP;
}
- nsim_node = kzalloc_obj(*nsim_node, GFP_KERNEL);
+ nsim_node = kzalloc_obj(*nsim_node);
if (!nsim_node)
return -ENOMEM;
@@ -1464,7 +1464,7 @@ static int __nsim_dev_port_add(struct nsim_dev *nsim_dev, enum nsim_dev_port_typ
if (type == NSIM_DEV_PORT_TYPE_VF && !nsim_dev_get_vfs(nsim_dev))
return -EINVAL;
- nsim_dev_port = kzalloc_obj(*nsim_dev_port, GFP_KERNEL);
+ nsim_dev_port = kzalloc_obj(*nsim_dev_port);
if (!nsim_dev_port)
return -ENOMEM;
nsim_dev_port->port_index = nsim_dev_port_index(type, port_index);
diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c
index b1292a8c0ef1..1a42bdbfaa41 100644
--- a/drivers/net/netdevsim/fib.c
+++ b/drivers/net/netdevsim/fib.c
@@ -277,7 +277,7 @@ nsim_fib4_rt_create(struct nsim_fib_data *data,
{
struct nsim_fib4_rt *fib4_rt;
- fib4_rt = kzalloc_obj(*fib4_rt, GFP_KERNEL);
+ fib4_rt = kzalloc_obj(*fib4_rt);
if (!fib4_rt)
return NULL;
@@ -497,7 +497,7 @@ static int nsim_fib6_rt_nh_add(struct nsim_fib6_rt *fib6_rt,
{
struct nsim_fib6_rt_nh *fib6_rt_nh;
- fib6_rt_nh = kzalloc_obj(*fib6_rt_nh, GFP_KERNEL);
+ fib6_rt_nh = kzalloc_obj(*fib6_rt_nh);
if (!fib6_rt_nh)
return -ENOMEM;
@@ -544,7 +544,7 @@ nsim_fib6_rt_create(struct nsim_fib_data *data,
int i = 0;
int err;
- fib6_rt = kzalloc_obj(*fib6_rt, GFP_KERNEL);
+ fib6_rt = kzalloc_obj(*fib6_rt);
if (!fib6_rt)
return ERR_PTR(-ENOMEM);
@@ -1116,7 +1116,7 @@ static struct nsim_nexthop *nsim_nexthop_create(struct nsim_fib_data *data,
u64 occ = 0;
int i;
- nexthop = kzalloc_obj(*nexthop, GFP_KERNEL);
+ nexthop = kzalloc_obj(*nexthop);
if (!nexthop)
return ERR_PTR(-ENOMEM);
@@ -1556,7 +1556,7 @@ struct nsim_fib_data *nsim_fib_create(struct devlink *devlink,
struct nsim_dev *nsim_dev;
int err;
- data = kzalloc_obj(*data, GFP_KERNEL);
+ data = kzalloc_obj(*data);
if (!data)
return ERR_PTR(-ENOMEM);
data->devlink = devlink;
diff --git a/drivers/net/netdevsim/hwstats.c b/drivers/net/netdevsim/hwstats.c
index 57b782aa1046..14234a4cc244 100644
--- a/drivers/net/netdevsim/hwstats.c
+++ b/drivers/net/netdevsim/hwstats.c
@@ -238,7 +238,7 @@ nsim_dev_hwstats_enable_ifindex(struct nsim_dev_hwstats *hwstats,
goto out_unlock_list;
}
- hwsdev = kzalloc_obj(*hwsdev, GFP_KERNEL);
+ hwsdev = kzalloc_obj(*hwsdev);
if (!hwsdev) {
err = -ENOMEM;
goto out_put_netdev;
diff --git a/drivers/net/netdevsim/psample.c b/drivers/net/netdevsim/psample.c
index 39250b9d201f..47d24bc64ee4 100644
--- a/drivers/net/netdevsim/psample.c
+++ b/drivers/net/netdevsim/psample.c
@@ -200,7 +200,7 @@ int nsim_dev_psample_init(struct nsim_dev *nsim_dev)
struct nsim_dev_psample *psample;
int err;
- psample = kzalloc_obj(*psample, GFP_KERNEL);
+ psample = kzalloc_obj(*psample);
if (!psample)
return -ENOMEM;
nsim_dev->psample = psample;