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 /fs/pstore | |
| parent | e19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff) | |
| download | lwn-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 'fs/pstore')
| -rw-r--r-- | fs/pstore/blk.c | 2 | ||||
| -rw-r--r-- | fs/pstore/inode.c | 6 | ||||
| -rw-r--r-- | fs/pstore/platform.c | 2 | ||||
| -rw-r--r-- | fs/pstore/ram.c | 2 | ||||
| -rw-r--r-- | fs/pstore/ram_core.c | 4 | ||||
| -rw-r--r-- | fs/pstore/zone.c | 4 |
6 files changed, 10 insertions, 10 deletions
diff --git a/fs/pstore/blk.c b/fs/pstore/blk.c index 0c9c8b6fdbb8..12070b6a7b11 100644 --- a/fs/pstore/blk.c +++ b/fs/pstore/blk.c @@ -297,7 +297,7 @@ static int __init __best_effort_init(void) return -EINVAL; } - best_effort_dev = kzalloc_obj(*best_effort_dev, GFP_KERNEL); + best_effort_dev = kzalloc_obj(*best_effort_dev); if (!best_effort_dev) return -ENOMEM; diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 8ebcd231e09a..83fa0bb3435a 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -70,7 +70,7 @@ static void *pstore_ftrace_seq_start(struct seq_file *s, loff_t *pos) struct pstore_private *ps = s->private; struct pstore_ftrace_seq_data *data __free(kfree) = NULL; - data = kzalloc_obj(*data, GFP_KERNEL); + data = kzalloc_obj(*data); if (!data) return NULL; @@ -365,7 +365,7 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record) record->psi->name, record->id, record->compressed ? ".enc.z" : ""); - private = kzalloc_obj(*private, GFP_KERNEL); + private = kzalloc_obj(*private); if (!private) return -ENOMEM; @@ -477,7 +477,7 @@ static int pstore_init_fs_context(struct fs_context *fc) { struct pstore_context *ctx; - ctx = kzalloc_obj(struct pstore_context, GFP_KERNEL); + ctx = kzalloc_obj(struct pstore_context); if (!ctx) return -ENOMEM; diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index ff9603bb89db..1d76c9d92056 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -683,7 +683,7 @@ void pstore_get_backend_records(struct pstore_info *psi, struct pstore_record *record; int rc; - record = kzalloc_obj(*record, GFP_KERNEL); + record = kzalloc_obj(*record); if (!record) { pr_err("out of memory creating record\n"); break; diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 79f801c913bf..c1cbf2fd1c0f 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -539,7 +539,7 @@ static int ramoops_init_przs(const char *name, goto fail; } - prz_ar = kzalloc_objs(**przs, *cnt, GFP_KERNEL); + prz_ar = kzalloc_objs(**przs, *cnt); if (!prz_ar) goto fail; diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c index 49d022b85d8a..7930c886dbf5 100644 --- a/fs/pstore/ram_core.c +++ b/fs/pstore/ram_core.c @@ -438,7 +438,7 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size, return NULL; } - pages = kmalloc_objs(struct page *, page_count, GFP_KERNEL); + pages = kmalloc_objs(struct page *, page_count); if (!pages) { pr_err("%s: Failed to allocate array for %u pages\n", __func__, page_count); @@ -605,7 +605,7 @@ struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size, struct persistent_ram_zone *prz; int ret = -ENOMEM; - prz = kzalloc_obj(struct persistent_ram_zone, GFP_KERNEL); + prz = kzalloc_obj(struct persistent_ram_zone); if (!prz) { pr_err("failed to allocate persistent ram zone\n"); goto err; diff --git a/fs/pstore/zone.c b/fs/pstore/zone.c index 6687d255a36b..a3b003f9a3a0 100644 --- a/fs/pstore/zone.c +++ b/fs/pstore/zone.c @@ -1166,7 +1166,7 @@ static struct pstore_zone *psz_init_zone(enum pstore_type_id type, return ERR_PTR(-ENOMEM); } - zone = kzalloc_obj(struct pstore_zone, GFP_KERNEL); + zone = kzalloc_obj(struct pstore_zone); if (!zone) return ERR_PTR(-ENOMEM); @@ -1218,7 +1218,7 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type, return ERR_PTR(-EINVAL); } - zones = kzalloc_objs(*zones, c, GFP_KERNEL); + zones = kzalloc_objs(*zones, c); if (!zones) { pr_err("allocate for zones %s failed\n", name); return ERR_PTR(-ENOMEM); |
