summaryrefslogtreecommitdiff
path: root/drivers/nvdimm
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/nvdimm
parente19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff)
downloadlwn-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.tar.gz
lwn-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.zip
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/nvdimm')
-rw-r--r--drivers/nvdimm/badrange.c2
-rw-r--r--drivers/nvdimm/btt.c4
-rw-r--r--drivers/nvdimm/btt_devs.c2
-rw-r--r--drivers/nvdimm/bus.c4
-rw-r--r--drivers/nvdimm/core.c2
-rw-r--r--drivers/nvdimm/dax_devs.c2
-rw-r--r--drivers/nvdimm/dimm.c2
-rw-r--r--drivers/nvdimm/dimm_devs.c2
-rw-r--r--drivers/nvdimm/label.c2
-rw-r--r--drivers/nvdimm/namespace_devs.c16
-rw-r--r--drivers/nvdimm/nd_perf.c2
-rw-r--r--drivers/nvdimm/nd_virtio.c2
-rw-r--r--drivers/nvdimm/of_pmem.c2
-rw-r--r--drivers/nvdimm/pfn_devs.c2
-rw-r--r--drivers/nvdimm/ramdax.c4
15 files changed, 25 insertions, 25 deletions
diff --git a/drivers/nvdimm/badrange.c b/drivers/nvdimm/badrange.c
index 7d2422f72e66..551cb0691856 100644
--- a/drivers/nvdimm/badrange.c
+++ b/drivers/nvdimm/badrange.c
@@ -50,7 +50,7 @@ static int add_badrange(struct badrange *badrange, u64 addr, u64 length)
struct badrange_entry *bre, *bre_new;
spin_unlock(&badrange->lock);
- bre_new = kzalloc_obj(*bre_new, GFP_KERNEL);
+ bre_new = kzalloc_obj(*bre_new);
spin_lock(&badrange->lock);
if (list_empty(&badrange->list)) {
diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
index c47785274d3a..afbefc5f49bc 100644
--- a/drivers/nvdimm/btt.c
+++ b/drivers/nvdimm/btt.c
@@ -751,7 +751,7 @@ static struct arena_info *alloc_arena(struct btt *btt, size_t size,
u64 logsize, mapsize, datasize;
u64 available = size;
- arena = kzalloc_obj(*arena, GFP_KERNEL);
+ arena = kzalloc_obj(*arena);
if (!arena)
return NULL;
arena->nd_btt = btt->nd_btt;
@@ -854,7 +854,7 @@ static int discover_arenas(struct btt *btt)
size_t cur_off = 0;
int num_arenas = 0;
- struct btt_sb *super __free(kfree) = kzalloc_obj(*super, GFP_KERNEL);
+ struct btt_sb *super __free(kfree) = kzalloc_obj(*super);
if (!super)
return -ENOMEM;
diff --git a/drivers/nvdimm/btt_devs.c b/drivers/nvdimm/btt_devs.c
index ab9d0ad53724..d6b2f157368f 100644
--- a/drivers/nvdimm/btt_devs.c
+++ b/drivers/nvdimm/btt_devs.c
@@ -180,7 +180,7 @@ static struct device *__nd_btt_create(struct nd_region *nd_region,
struct nd_btt *nd_btt;
struct device *dev;
- nd_btt = kzalloc_obj(*nd_btt, GFP_KERNEL);
+ nd_btt = kzalloc_obj(*nd_btt);
if (!nd_btt)
return NULL;
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
index 767a4f1e27e5..bd9621d3f73c 100644
--- a/drivers/nvdimm/bus.c
+++ b/drivers/nvdimm/bus.c
@@ -336,7 +336,7 @@ struct nvdimm_bus *nvdimm_bus_register(struct device *parent,
struct nvdimm_bus *nvdimm_bus;
int rc;
- nvdimm_bus = kzalloc_obj(*nvdimm_bus, GFP_KERNEL);
+ nvdimm_bus = kzalloc_obj(*nvdimm_bus);
if (!nvdimm_bus)
return NULL;
INIT_LIST_HEAD(&nvdimm_bus->list);
@@ -736,7 +736,7 @@ int nvdimm_bus_create_ndctl(struct nvdimm_bus *nvdimm_bus)
struct device *dev;
int rc;
- dev = kzalloc_obj(*dev, GFP_KERNEL);
+ dev = kzalloc_obj(*dev);
if (!dev)
return -ENOMEM;
device_initialize(dev);
diff --git a/drivers/nvdimm/core.c b/drivers/nvdimm/core.c
index 5c2e4160e6ae..34bd886c04a6 100644
--- a/drivers/nvdimm/core.c
+++ b/drivers/nvdimm/core.c
@@ -80,7 +80,7 @@ static struct nvdimm_map *alloc_nvdimm_map(struct device *dev,
struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(dev);
struct nvdimm_map *nvdimm_map;
- nvdimm_map = kzalloc_obj(*nvdimm_map, GFP_KERNEL);
+ nvdimm_map = kzalloc_obj(*nvdimm_map);
if (!nvdimm_map)
return NULL;
diff --git a/drivers/nvdimm/dax_devs.c b/drivers/nvdimm/dax_devs.c
index 6d25a7fbf751..decc70f2fe3f 100644
--- a/drivers/nvdimm/dax_devs.c
+++ b/drivers/nvdimm/dax_devs.c
@@ -50,7 +50,7 @@ static struct nd_dax *nd_dax_alloc(struct nd_region *nd_region)
struct nd_dax *nd_dax;
struct device *dev;
- nd_dax = kzalloc_obj(*nd_dax, GFP_KERNEL);
+ nd_dax = kzalloc_obj(*nd_dax);
if (!nd_dax)
return NULL;
diff --git a/drivers/nvdimm/dimm.c b/drivers/nvdimm/dimm.c
index f7c7ecee80a7..addbd149a9c1 100644
--- a/drivers/nvdimm/dimm.c
+++ b/drivers/nvdimm/dimm.c
@@ -39,7 +39,7 @@ static int nvdimm_probe(struct device *dev)
*/
nvdimm_clear_locked(dev);
- ndd = kzalloc_obj(*ndd, GFP_KERNEL);
+ ndd = kzalloc_obj(*ndd);
if (!ndd)
return -ENOMEM;
diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c
index c0366fd5d6a0..81daeb4d11a9 100644
--- a/drivers/nvdimm/dimm_devs.c
+++ b/drivers/nvdimm/dimm_devs.c
@@ -575,7 +575,7 @@ struct nvdimm *__nvdimm_create(struct nvdimm_bus *nvdimm_bus,
const struct nvdimm_security_ops *sec_ops,
const struct nvdimm_fw_ops *fw_ops)
{
- struct nvdimm *nvdimm = kzalloc_obj(*nvdimm, GFP_KERNEL);
+ struct nvdimm *nvdimm = kzalloc_obj(*nvdimm);
struct device *dev;
if (!nvdimm)
diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c
index e370eaf17099..4218e3ac4a2a 100644
--- a/drivers/nvdimm/label.c
+++ b/drivers/nvdimm/label.c
@@ -982,7 +982,7 @@ static int init_labels(struct nd_mapping *nd_mapping, int num_labels)
* they can be garbage collected after writing the new labels.
*/
for (i = old_num_labels; i < num_labels; i++) {
- label_ent = kzalloc_obj(*label_ent, GFP_KERNEL);
+ label_ent = kzalloc_obj(*label_ent);
if (!label_ent)
return -ENOMEM;
mutex_lock(&nd_mapping->lock);
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index 6f2cd7d32467..557fe0cb43e2 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -1530,11 +1530,11 @@ static struct device **create_namespace_io(struct nd_region *nd_region)
struct device *dev, **devs;
struct resource *res;
- nsio = kzalloc_obj(*nsio, GFP_KERNEL);
+ nsio = kzalloc_obj(*nsio);
if (!nsio)
return NULL;
- devs = kzalloc_objs(struct device *, 2, GFP_KERNEL);
+ devs = kzalloc_objs(struct device *, 2);
if (!devs) {
kfree(nsio);
return NULL;
@@ -1693,7 +1693,7 @@ static struct device *create_namespace_pmem(struct nd_region *nd_region,
nsl_uuid_raw(ndd, nd_label));
}
- nspm = kzalloc_obj(*nspm, GFP_KERNEL);
+ nspm = kzalloc_obj(*nspm);
if (!nspm)
return ERR_PTR(-ENOMEM);
@@ -1797,7 +1797,7 @@ static struct device *nd_namespace_pmem_create(struct nd_region *nd_region)
if (!is_memory(&nd_region->dev))
return NULL;
- nspm = kzalloc_obj(*nspm, GFP_KERNEL);
+ nspm = kzalloc_obj(*nspm);
if (!nspm)
return NULL;
@@ -1931,7 +1931,7 @@ static struct device **scan_labels(struct nd_region *nd_region)
struct nvdimm_drvdata *ndd = to_ndd(nd_mapping);
resource_size_t map_end = nd_mapping->start + nd_mapping->size - 1;
- devs = kzalloc_objs(dev, 2, GFP_KERNEL);
+ devs = kzalloc_objs(dev, 2);
if (!devs)
return NULL;
@@ -1954,7 +1954,7 @@ static struct device **scan_labels(struct nd_region *nd_region)
if (i < count)
continue;
if (count) {
- __devs = kzalloc_objs(dev, count + 2, GFP_KERNEL);
+ __devs = kzalloc_objs(dev, count + 2);
if (!__devs)
goto err;
memcpy(__devs, devs, sizeof(dev) * count);
@@ -1984,7 +1984,7 @@ static struct device **scan_labels(struct nd_region *nd_region)
/* Publish a zero-sized namespace for userspace to configure. */
nd_mapping_free_labels(nd_mapping);
- nspm = kzalloc_obj(*nspm, GFP_KERNEL);
+ nspm = kzalloc_obj(*nspm);
if (!nspm)
goto err;
dev = &nspm->nsio.common.dev;
@@ -2118,7 +2118,7 @@ static int init_active_labels(struct nd_region *nd_region)
for (j = 0; j < count; j++) {
struct nd_namespace_label *label;
- label_ent = kzalloc_obj(*label_ent, GFP_KERNEL);
+ label_ent = kzalloc_obj(*label_ent);
if (!label_ent)
break;
label = nd_label_active(ndd, j);
diff --git a/drivers/nvdimm/nd_perf.c b/drivers/nvdimm/nd_perf.c
index 5338a440890b..9bd8dff3d35a 100644
--- a/drivers/nvdimm/nd_perf.c
+++ b/drivers/nvdimm/nd_perf.c
@@ -184,7 +184,7 @@ static int create_cpumask_attr_group(struct nvdimm_pmu *nd_pmu)
struct attribute **attrs_group;
struct attribute_group *nvdimm_pmu_cpumask_group;
- pmu_events_attr = kzalloc_obj(*pmu_events_attr, GFP_KERNEL);
+ pmu_events_attr = kzalloc_obj(*pmu_events_attr);
if (!pmu_events_attr)
return -ENOMEM;
diff --git a/drivers/nvdimm/nd_virtio.c b/drivers/nvdimm/nd_virtio.c
index e70aee4ef7a9..4176046627be 100644
--- a/drivers/nvdimm/nd_virtio.c
+++ b/drivers/nvdimm/nd_virtio.c
@@ -55,7 +55,7 @@ static int virtio_pmem_flush(struct nd_region *nd_region)
return -EIO;
}
- req_data = kmalloc_obj(*req_data, GFP_KERNEL);
+ req_data = kmalloc_obj(*req_data);
if (!req_data)
return -ENOMEM;
diff --git a/drivers/nvdimm/of_pmem.c b/drivers/nvdimm/of_pmem.c
index f78aede2aab5..776b7778a12e 100644
--- a/drivers/nvdimm/of_pmem.c
+++ b/drivers/nvdimm/of_pmem.c
@@ -26,7 +26,7 @@ static int of_pmem_region_probe(struct platform_device *pdev)
if (!np)
return -ENXIO;
- priv = kzalloc_obj(*priv, GFP_KERNEL);
+ priv = kzalloc_obj(*priv);
if (!priv)
return -ENOMEM;
diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c
index 5d1e1c214847..8fa9c16aba7e 100644
--- a/drivers/nvdimm/pfn_devs.c
+++ b/drivers/nvdimm/pfn_devs.c
@@ -311,7 +311,7 @@ static struct nd_pfn *nd_pfn_alloc(struct nd_region *nd_region)
struct nd_pfn *nd_pfn;
struct device *dev;
- nd_pfn = kzalloc_obj(*nd_pfn, GFP_KERNEL);
+ nd_pfn = kzalloc_obj(*nd_pfn);
if (!nd_pfn)
return NULL;
diff --git a/drivers/nvdimm/ramdax.c b/drivers/nvdimm/ramdax.c
index 8d6cfffbb56c..e76fca736d76 100644
--- a/drivers/nvdimm/ramdax.c
+++ b/drivers/nvdimm/ramdax.c
@@ -40,7 +40,7 @@ static int ramdax_register_region(struct resource *res,
struct nd_interleave_set *nd_set;
int nid = phys_to_target_node(res->start);
- nd_set = kzalloc_obj(*nd_set, GFP_KERNEL);
+ nd_set = kzalloc_obj(*nd_set);
if (!nd_set)
return -ENOMEM;
@@ -80,7 +80,7 @@ static int ramdax_register_dimm(struct resource *res, void *data)
struct ramdax_dimm *dimm;
int err;
- dimm = kzalloc_obj(*dimm, GFP_KERNEL);
+ dimm = kzalloc_obj(*dimm);
if (!dimm)
return -ENOMEM;