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 /block/partitions | |
| 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 'block/partitions')
| -rw-r--r-- | block/partitions/aix.c | 2 | ||||
| -rw-r--r-- | block/partitions/cmdline.c | 4 | ||||
| -rw-r--r-- | block/partitions/core.c | 2 | ||||
| -rw-r--r-- | block/partitions/efi.c | 2 | ||||
| -rw-r--r-- | block/partitions/ibm.c | 6 | ||||
| -rw-r--r-- | block/partitions/ldm.c | 10 |
6 files changed, 13 insertions, 13 deletions
diff --git a/block/partitions/aix.c b/block/partitions/aix.c index 97c8fa2a866f..a886cefbefbb 100644 --- a/block/partitions/aix.c +++ b/block/partitions/aix.c @@ -199,7 +199,7 @@ int aix_partition(struct parsed_partitions *state) numlvs = be16_to_cpu(p->numlvs); put_dev_sector(sect); } - lvip = kzalloc_objs(struct lv_info, state->limit, GFP_KERNEL); + lvip = kzalloc_objs(struct lv_info, state->limit); if (!lvip) return 0; if (numlvs && (d = read_part_sector(state, vgda_sector + 1, §))) { diff --git a/block/partitions/cmdline.c b/block/partitions/cmdline.c index 5d604a64842e..a2b1870c3fd4 100644 --- a/block/partitions/cmdline.c +++ b/block/partitions/cmdline.c @@ -46,7 +46,7 @@ static int parse_subpart(struct cmdline_subpart **subpart, char *partdef) *subpart = NULL; - new_subpart = kzalloc_obj(struct cmdline_subpart, GFP_KERNEL); + new_subpart = kzalloc_obj(struct cmdline_subpart); if (!new_subpart) return -ENOMEM; @@ -122,7 +122,7 @@ static int parse_parts(struct cmdline_parts **parts, char *bdevdef) *parts = NULL; - newparts = kzalloc_obj(struct cmdline_parts, GFP_KERNEL); + newparts = kzalloc_obj(struct cmdline_parts); if (!newparts) return -ENOMEM; diff --git a/block/partitions/core.c b/block/partitions/core.c index 189ab5650351..740228750aaf 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -94,7 +94,7 @@ static struct parsed_partitions *allocate_partitions(struct gendisk *hd) struct parsed_partitions *state; int nr = DISK_MAX_PARTS; - state = kzalloc_obj(*state, GFP_KERNEL); + state = kzalloc_obj(*state); if (!state) return NULL; diff --git a/block/partitions/efi.c b/block/partitions/efi.c index ff145c6306e0..75474fb3848e 100644 --- a/block/partitions/efi.c +++ b/block/partitions/efi.c @@ -595,7 +595,7 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt, lastlba = last_lba(state->disk); if (!force_gpt) { /* This will be added to the EFI Spec. per Intel after v1.02. */ - legacymbr = kzalloc_obj(*legacymbr, GFP_KERNEL); + legacymbr = kzalloc_obj(*legacymbr); if (!legacymbr) goto fail; diff --git a/block/partitions/ibm.c b/block/partitions/ibm.c index b81b7a690787..9311ad5fb95d 100644 --- a/block/partitions/ibm.c +++ b/block/partitions/ibm.c @@ -347,13 +347,13 @@ int ibm_partition(struct parsed_partitions *state) nr_sectors = bdev_nr_sectors(bdev); if (nr_sectors == 0) goto out_symbol; - info = kmalloc_obj(dasd_information2_t, GFP_KERNEL); + info = kmalloc_obj(dasd_information2_t); if (info == NULL) goto out_symbol; - geo = kmalloc_obj(struct hd_geometry, GFP_KERNEL); + geo = kmalloc_obj(struct hd_geometry); if (geo == NULL) goto out_nogeo; - label = kmalloc_obj(union label_t, GFP_KERNEL); + label = kmalloc_obj(union label_t); if (label == NULL) goto out_nolab; /* set start if not filled by getgeo function e.g. virtblk */ diff --git a/block/partitions/ldm.c b/block/partitions/ldm.c index 27ffddd74e11..776b4ad95091 100644 --- a/block/partitions/ldm.c +++ b/block/partitions/ldm.c @@ -273,8 +273,8 @@ static bool ldm_validate_privheads(struct parsed_partitions *state, BUG_ON (!state || !ph1); - ph[1] = kmalloc_obj(*ph[1], GFP_KERNEL); - ph[2] = kmalloc_obj(*ph[2], GFP_KERNEL); + ph[1] = kmalloc_obj(*ph[1]); + ph[2] = kmalloc_obj(*ph[2]); if (!ph[1] || !ph[2]) { ldm_crit ("Out of memory."); goto out; @@ -362,7 +362,7 @@ static bool ldm_validate_tocblocks(struct parsed_partitions *state, BUG_ON(!state || !ldb); ph = &ldb->ph; tb[0] = &ldb->toc; - tb[1] = kmalloc_objs(*tb[1], 3, GFP_KERNEL); + tb[1] = kmalloc_objs(*tb[1], 3); if (!tb[1]) { ldm_crit("Out of memory."); goto err; @@ -1158,7 +1158,7 @@ static bool ldm_ldmdb_add (u8 *data, int len, struct ldmdb *ldb) BUG_ON (!data || !ldb); - vb = kmalloc_obj(*vb, GFP_KERNEL); + vb = kmalloc_obj(*vb); if (!vb) { ldm_crit ("Out of memory."); return false; @@ -1438,7 +1438,7 @@ int ldm_partition(struct parsed_partitions *state) if (!ldm_validate_partition_table(state)) return 0; - ldb = kmalloc_obj(*ldb, GFP_KERNEL); + ldb = kmalloc_obj(*ldb); if (!ldb) { ldm_crit ("Out of memory."); goto out; |
