Skip to content

Commit 323bbfc

Browse files
committed
Convert 'alloc_flex' family to use the new default GFP_KERNEL argument
This is the exact same thing as the 'alloc_obj()' version, only much smaller because there are a lot fewer users of the *alloc_flex() interface. As with alloc_obj() version, this was done entirely with mindless brute force, using the same script, except using 'flex' in the pattern rather than 'objs*'. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent bf4afc5 commit 323bbfc

File tree

310 files changed

+352
-352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

310 files changed

+352
-352
lines changed

arch/arm/kernel/atags_proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static int __init init_atags_procfs(void)
5454

5555
WARN_ON(tag->hdr.tag != ATAG_NONE);
5656

57-
b = kmalloc_flex(*b, data, size, GFP_KERNEL);
57+
b = kmalloc_flex(*b, data, size);
5858
if (!b)
5959
goto nomem;
6060

arch/arm64/kernel/machine_kexec_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
5252
for_each_mem_range(i, &start, &end)
5353
nr_ranges++;
5454

55-
cmem = kmalloc_flex(*cmem, ranges, nr_ranges, GFP_KERNEL);
55+
cmem = kmalloc_flex(*cmem, ranges, nr_ranges);
5656
if (!cmem)
5757
return -ENOMEM;
5858

arch/loongarch/kernel/machine_kexec_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
6868
for_each_mem_range(i, &start, &end)
6969
nr_ranges++;
7070

71-
cmem = kmalloc_flex(*cmem, ranges, nr_ranges, GFP_KERNEL);
71+
cmem = kmalloc_flex(*cmem, ranges, nr_ranges);
7272
if (!cmem)
7373
return -ENOMEM;
7474

arch/powerpc/platforms/ps3/device-init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
344344
repo->dev_index, repo->dev_type, port, blk_size, num_blocks,
345345
num_regions);
346346

347-
p = kzalloc_flex(*p, regions, num_regions, GFP_KERNEL);
347+
p = kzalloc_flex(*p, regions, num_regions);
348348
if (!p) {
349349
result = -ENOMEM;
350350
goto fail_malloc;

arch/riscv/kernel/machine_kexec_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
6464
nr_ranges = 1; /* For exclusion of crashkernel region */
6565
walk_system_ram_res(0, -1, &nr_ranges, get_nr_ram_ranges_callback);
6666

67-
cmem = kmalloc_flex(*cmem, ranges, nr_ranges, GFP_KERNEL);
67+
cmem = kmalloc_flex(*cmem, ranges, nr_ranges);
6868
if (!cmem)
6969
return -ENOMEM;
7070

arch/x86/events/intel/uncore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ static int __init uncore_type_init(struct intel_uncore_type *type)
10161016
} *attr_group;
10171017
for (i = 0; type->event_descs[i].attr.attr.name; i++);
10181018

1019-
attr_group = kzalloc_flex(*attr_group, attrs, i + 1, GFP_KERNEL);
1019+
attr_group = kzalloc_flex(*attr_group, attrs, i + 1);
10201020
if (!attr_group)
10211021
goto err;
10221022

arch/x86/events/rapl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ static int __init init_rapl_pmus(struct rapl_pmus **rapl_pmus_ptr, int rapl_pmu_
742742
else if (rapl_pmu_scope != PERF_PMU_SCOPE_PKG)
743743
return -EINVAL;
744744

745-
rapl_pmus = kzalloc_flex(*rapl_pmus, rapl_pmu, nr_rapl_pmu, GFP_KERNEL);
745+
rapl_pmus = kzalloc_flex(*rapl_pmus, rapl_pmu, nr_rapl_pmu);
746746
if (!rapl_pmus)
747747
return -ENOMEM;
748748

arch/x86/kernel/cpu/mce/dev-mcelog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static __init int dev_mcelog_init_device(void)
338338
int err;
339339

340340
mce_log_len = max(MCE_LOG_MIN_LEN, num_online_cpus());
341-
mcelog = kzalloc_flex(*mcelog, entry, mce_log_len, GFP_KERNEL);
341+
mcelog = kzalloc_flex(*mcelog, entry, mce_log_len);
342342
if (!mcelog)
343343
return -ENOMEM;
344344

crypto/deflate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static void *deflate_alloc_stream(void)
4040
DEFLATE_DEF_MEMLEVEL));
4141
struct deflate_stream *ctx;
4242

43-
ctx = kvmalloc_flex(*ctx, workspace, size, GFP_KERNEL);
43+
ctx = kvmalloc_flex(*ctx, workspace, size);
4444
if (!ctx)
4545
return ERR_PTR(-ENOMEM);
4646

crypto/zstd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static void *zstd_alloc_stream(void)
4444
if (!wksp_size)
4545
return ERR_PTR(-EINVAL);
4646

47-
ctx = kvmalloc_flex(*ctx, wksp, wksp_size, GFP_KERNEL);
47+
ctx = kvmalloc_flex(*ctx, wksp, wksp_size);
4848
if (!ctx)
4949
return ERR_PTR(-ENOMEM);
5050

0 commit comments

Comments
 (0)