Skip to content

Commit bf4afc5

Browse files
committed
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>
1 parent e19e1b4 commit bf4afc5

6,673 files changed

Lines changed: 13013 additions & 13013 deletions

File tree

Some content is hidden

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

arch/alpha/kernel/core_marvel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ marvel_agp_setup(alpha_agp_info *agp)
861861
if (!alpha_agpgart_size)
862862
return -ENOMEM;
863863

864-
aper = kmalloc_obj(*aper, GFP_KERNEL);
864+
aper = kmalloc_obj(*aper);
865865
if (aper == NULL) return -ENOMEM;
866866

867867
aper->arena = agp->hose->sg_pci;
@@ -1059,7 +1059,7 @@ marvel_agp_info(void)
10591059
/*
10601060
* Allocate the info structure.
10611061
*/
1062-
agp = kmalloc_obj(*agp, GFP_KERNEL);
1062+
agp = kmalloc_obj(*agp);
10631063
if (!agp)
10641064
return NULL;
10651065

arch/alpha/kernel/core_titan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ titan_agp_setup(alpha_agp_info *agp)
594594
if (!alpha_agpgart_size)
595595
return -ENOMEM;
596596

597-
aper = kmalloc_obj(struct titan_agp_aperture, GFP_KERNEL);
597+
aper = kmalloc_obj(struct titan_agp_aperture);
598598
if (aper == NULL)
599599
return -ENOMEM;
600600

@@ -760,7 +760,7 @@ titan_agp_info(void)
760760
/*
761761
* Allocate the info structure.
762762
*/
763-
agp = kmalloc_obj(*agp, GFP_KERNEL);
763+
agp = kmalloc_obj(*agp);
764764
if (!agp)
765765
return NULL;
766766

arch/alpha/kernel/module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ process_reloc_for_got(Elf64_Rela *rela,
4646
goto found_entry;
4747
}
4848

49-
g = kmalloc_obj(*g, GFP_KERNEL);
49+
g = kmalloc_obj(*g);
5050
g->next = chains[r_sym].next;
5151
g->r_addend = r_addend;
5252
g->got_offset = *poffset;
@@ -93,7 +93,7 @@ module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs,
9393
}
9494

9595
nsyms = symtab->sh_size / sizeof(Elf64_Sym);
96-
chains = kzalloc_objs(struct got_entry, nsyms, GFP_KERNEL);
96+
chains = kzalloc_objs(struct got_entry, nsyms);
9797
if (!chains) {
9898
printk(KERN_ERR
9999
"module %s: no memory for symbol chain buffer\n",

arch/alpha/kernel/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static void pdev_save_srm_config(struct pci_dev *dev)
220220
printed = 1;
221221
}
222222

223-
tmp = kmalloc_obj(*tmp, GFP_KERNEL);
223+
tmp = kmalloc_obj(*tmp);
224224
if (!tmp) {
225225
printk(KERN_ERR "%s: kmalloc() failed!\n", __func__);
226226
return;

arch/alpha/kernel/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ register_cpus(void)
392392
int i;
393393

394394
for_each_possible_cpu(i) {
395-
struct cpu *p = kzalloc_obj(*p, GFP_KERNEL);
395+
struct cpu *p = kzalloc_obj(*p);
396396
if (!p)
397397
return -ENOMEM;
398398
register_cpu(p, i);

arch/arc/kernel/unwind.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ void *unwind_add_table(struct module *module, const void *table_start,
366366
if (table_size <= 0)
367367
return NULL;
368368

369-
table = kmalloc_obj(*table, GFP_KERNEL);
369+
table = kmalloc_obj(*table);
370370
if (!table)
371371
return NULL;
372372

arch/arc/net/bpf_jit_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ static int jit_prepare_final_mem_alloc(struct jit_context *ctx)
11401140
}
11411141

11421142
if (ctx->need_extra_pass) {
1143-
ctx->jit_data = kzalloc_obj(*ctx->jit_data, GFP_KERNEL);
1143+
ctx->jit_data = kzalloc_obj(*ctx->jit_data);
11441144
if (!ctx->jit_data)
11451145
return -ENOMEM;
11461146
}

arch/arm/common/locomo.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
222222
struct locomo_dev *dev;
223223
int ret;
224224

225-
dev = kzalloc_obj(struct locomo_dev, GFP_KERNEL);
225+
dev = kzalloc_obj(struct locomo_dev);
226226
if (!dev) {
227227
ret = -ENOMEM;
228228
goto out;
@@ -277,7 +277,7 @@ static int locomo_suspend(struct platform_device *dev, pm_message_t state)
277277
struct locomo_save_data *save;
278278
unsigned long flags;
279279

280-
save = kmalloc_obj(struct locomo_save_data, GFP_KERNEL);
280+
save = kmalloc_obj(struct locomo_save_data);
281281
if (!save)
282282
return -ENOMEM;
283283

@@ -360,7 +360,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
360360
unsigned long r;
361361
int i, ret = -ENODEV;
362362

363-
lchip = kzalloc_obj(struct locomo, GFP_KERNEL);
363+
lchip = kzalloc_obj(struct locomo);
364364
if (!lchip)
365365
return -ENOMEM;
366366

arch/arm/common/sa1111.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
737737
unsigned i;
738738
int ret;
739739

740-
dev = kzalloc_obj(struct sa1111_dev, GFP_KERNEL);
740+
dev = kzalloc_obj(struct sa1111_dev);
741741
if (!dev) {
742742
ret = -ENOMEM;
743743
goto err_alloc;
@@ -969,7 +969,7 @@ static int sa1111_suspend_noirq(struct device *dev)
969969
unsigned int val;
970970
void __iomem *base;
971971

972-
save = kmalloc_obj(struct sa1111_save_data, GFP_KERNEL);
972+
save = kmalloc_obj(struct sa1111_save_data);
973973
if (!save)
974974
return -ENOMEM;
975975
sachip->saved_state = save;

arch/arm/common/scoop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static int scoop_probe(struct platform_device *pdev)
185185
if (!mem)
186186
return -EINVAL;
187187

188-
devptr = kzalloc_obj(struct scoop_dev, GFP_KERNEL);
188+
devptr = kzalloc_obj(struct scoop_dev);
189189
if (!devptr)
190190
return -ENOMEM;
191191

0 commit comments

Comments
 (0)