summaryrefslogtreecommitdiff
path: root/drivers/of
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/of
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/of')
-rw-r--r--drivers/of/address.c2
-rw-r--r--drivers/of/dynamic.c4
-rw-r--r--drivers/of/irq.c2
-rw-r--r--drivers/of/of_reserved_mem.c2
-rw-r--r--drivers/of/overlay.c6
-rw-r--r--drivers/of/platform.c2
-rw-r--r--drivers/of/unittest.c8
7 files changed, 13 insertions, 13 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 590d2db007d2..cf4aab11e9b1 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -929,7 +929,7 @@ int of_dma_get_range(struct device_node *np, const struct bus_dma_region **map)
if (!num_ranges)
return -EINVAL;
- r = kzalloc_objs(*r, num_ranges + 1, GFP_KERNEL);
+ r = kzalloc_objs(*r, num_ranges + 1);
if (!r)
return -ENOMEM;
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index 1b3cc351a895..1a06175def37 100644
--- a/drivers/of/dynamic.c
+++ b/drivers/of/dynamic.c
@@ -454,7 +454,7 @@ struct device_node *__of_node_dup(const struct device_node *np,
{
struct device_node *node;
- node = kzalloc_obj(*node, GFP_KERNEL);
+ node = kzalloc_obj(*node);
if (!node)
return NULL;
node->full_name = kstrdup(full_name, GFP_KERNEL);
@@ -908,7 +908,7 @@ int of_changeset_action(struct of_changeset *ocs, unsigned long action,
if (WARN_ON(action >= ARRAY_SIZE(action_names)))
return -EINVAL;
- ce = kzalloc_obj(*ce, GFP_KERNEL);
+ ce = kzalloc_obj(*ce);
if (!ce)
return -ENOMEM;
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 55c2de65a13a..6367c67732d2 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -669,7 +669,7 @@ void __init of_irq_init(const struct of_device_id *matches)
* Here, we allocate and populate an of_intc_desc with the node
* pointer, interrupt-parent device_node etc.
*/
- desc = kzalloc_obj(*desc, GFP_KERNEL);
+ desc = kzalloc_obj(*desc);
if (!desc) {
of_node_put(np);
goto err;
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 0344c55300b6..1fd28f805610 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -646,7 +646,7 @@ int of_reserved_mem_device_init_by_idx(struct device *dev,
if (!rmem || !rmem->ops || !rmem->ops->device_init)
return -EINVAL;
- rd = kmalloc_obj(struct rmem_assigned_device, GFP_KERNEL);
+ rd = kmalloc_obj(struct rmem_assigned_device);
if (!rd)
return -ENOMEM;
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index 87faec65c865..c1c5686fc7b1 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -248,7 +248,7 @@ static struct property *dup_and_fixup_symbol_prop(
return NULL;
target_path_len = strlen(target_path);
- new_prop = kzalloc_obj(*new_prop, GFP_KERNEL);
+ new_prop = kzalloc_obj(*new_prop);
if (!new_prop)
goto err_free_target_path;
@@ -784,7 +784,7 @@ static int init_overlay_changeset(struct overlay_changeset *ovcs,
of_node_put(node);
}
- fragments = kzalloc_objs(*fragments, cnt, GFP_KERNEL);
+ fragments = kzalloc_objs(*fragments, cnt);
if (!fragments) {
ret = -ENOMEM;
goto err_out;
@@ -1009,7 +1009,7 @@ int of_overlay_fdt_apply(const void *overlay_fdt, u32 overlay_fdt_size,
if (overlay_fdt_size < size)
return -EINVAL;
- ovcs = kzalloc_obj(*ovcs, GFP_KERNEL);
+ ovcs = kzalloc_obj(*ovcs);
if (!ovcs)
return -ENOMEM;
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index d9a717c47ad6..ba591fbceb56 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -111,7 +111,7 @@ struct platform_device *of_device_alloc(struct device_node *np,
/* Populate the resource table */
if (num_reg) {
- res = kzalloc_objs(*res, num_reg, GFP_KERNEL);
+ res = kzalloc_objs(*res, num_reg);
if (!res) {
platform_device_put(dev);
return NULL;
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index a8b70b49e780..2940295843e6 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -197,7 +197,7 @@ static void __init of_unittest_dynamic(void)
}
/* Array of 4 properties for the purpose of testing */
- prop = kzalloc_objs(*prop, 4, GFP_KERNEL);
+ prop = kzalloc_objs(*prop, 4);
if (!prop) {
unittest(0, "kzalloc() failed\n");
return;
@@ -379,7 +379,7 @@ static void __init of_unittest_check_phandles(void)
}
}
- nh = kzalloc_obj(*nh, GFP_KERNEL);
+ nh = kzalloc_obj(*nh);
if (!nh)
return;
@@ -1136,7 +1136,7 @@ static void __init of_unittest_dma_ranges_one(const char *path,
dma_addr_t dma_addr;
struct device *dev_bogus;
- dev_bogus = kzalloc_obj(struct device, GFP_KERNEL);
+ dev_bogus = kzalloc_obj(struct device);
if (!dev_bogus) {
unittest(0, "kzalloc() failed\n");
kfree(map);
@@ -2275,7 +2275,7 @@ static int unittest_gpio_probe(struct platform_device *pdev)
unittest_gpio_probe_count++;
- devptr = kzalloc_obj(*devptr, GFP_KERNEL);
+ devptr = kzalloc_obj(*devptr);
if (!devptr)
return -ENOMEM;