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>
This commit is contained in:
Linus Torvalds 2026-02-21 16:37:42 -08:00
parent e19e1b480a
commit bf4afc53b7
6673 changed files with 13013 additions and 13013 deletions

View file

@ -861,7 +861,7 @@ marvel_agp_setup(alpha_agp_info *agp)
if (!alpha_agpgart_size) if (!alpha_agpgart_size)
return -ENOMEM; return -ENOMEM;
aper = kmalloc_obj(*aper, GFP_KERNEL); aper = kmalloc_obj(*aper);
if (aper == NULL) return -ENOMEM; if (aper == NULL) return -ENOMEM;
aper->arena = agp->hose->sg_pci; aper->arena = agp->hose->sg_pci;
@ -1059,7 +1059,7 @@ marvel_agp_info(void)
/* /*
* Allocate the info structure. * Allocate the info structure.
*/ */
agp = kmalloc_obj(*agp, GFP_KERNEL); agp = kmalloc_obj(*agp);
if (!agp) if (!agp)
return NULL; return NULL;

View file

@ -594,7 +594,7 @@ titan_agp_setup(alpha_agp_info *agp)
if (!alpha_agpgart_size) if (!alpha_agpgart_size)
return -ENOMEM; return -ENOMEM;
aper = kmalloc_obj(struct titan_agp_aperture, GFP_KERNEL); aper = kmalloc_obj(struct titan_agp_aperture);
if (aper == NULL) if (aper == NULL)
return -ENOMEM; return -ENOMEM;
@ -760,7 +760,7 @@ titan_agp_info(void)
/* /*
* Allocate the info structure. * Allocate the info structure.
*/ */
agp = kmalloc_obj(*agp, GFP_KERNEL); agp = kmalloc_obj(*agp);
if (!agp) if (!agp)
return NULL; return NULL;

View file

@ -46,7 +46,7 @@ process_reloc_for_got(Elf64_Rela *rela,
goto found_entry; goto found_entry;
} }
g = kmalloc_obj(*g, GFP_KERNEL); g = kmalloc_obj(*g);
g->next = chains[r_sym].next; g->next = chains[r_sym].next;
g->r_addend = r_addend; g->r_addend = r_addend;
g->got_offset = *poffset; g->got_offset = *poffset;
@ -93,7 +93,7 @@ module_frob_arch_sections(Elf64_Ehdr *hdr, Elf64_Shdr *sechdrs,
} }
nsyms = symtab->sh_size / sizeof(Elf64_Sym); nsyms = symtab->sh_size / sizeof(Elf64_Sym);
chains = kzalloc_objs(struct got_entry, nsyms, GFP_KERNEL); chains = kzalloc_objs(struct got_entry, nsyms);
if (!chains) { if (!chains) {
printk(KERN_ERR printk(KERN_ERR
"module %s: no memory for symbol chain buffer\n", "module %s: no memory for symbol chain buffer\n",

View file

@ -220,7 +220,7 @@ static void pdev_save_srm_config(struct pci_dev *dev)
printed = 1; printed = 1;
} }
tmp = kmalloc_obj(*tmp, GFP_KERNEL); tmp = kmalloc_obj(*tmp);
if (!tmp) { if (!tmp) {
printk(KERN_ERR "%s: kmalloc() failed!\n", __func__); printk(KERN_ERR "%s: kmalloc() failed!\n", __func__);
return; return;

View file

@ -392,7 +392,7 @@ register_cpus(void)
int i; int i;
for_each_possible_cpu(i) { for_each_possible_cpu(i) {
struct cpu *p = kzalloc_obj(*p, GFP_KERNEL); struct cpu *p = kzalloc_obj(*p);
if (!p) if (!p)
return -ENOMEM; return -ENOMEM;
register_cpu(p, i); register_cpu(p, i);

View file

@ -366,7 +366,7 @@ void *unwind_add_table(struct module *module, const void *table_start,
if (table_size <= 0) if (table_size <= 0)
return NULL; return NULL;
table = kmalloc_obj(*table, GFP_KERNEL); table = kmalloc_obj(*table);
if (!table) if (!table)
return NULL; return NULL;

View file

@ -1140,7 +1140,7 @@ static int jit_prepare_final_mem_alloc(struct jit_context *ctx)
} }
if (ctx->need_extra_pass) { if (ctx->need_extra_pass) {
ctx->jit_data = kzalloc_obj(*ctx->jit_data, GFP_KERNEL); ctx->jit_data = kzalloc_obj(*ctx->jit_data);
if (!ctx->jit_data) if (!ctx->jit_data)
return -ENOMEM; return -ENOMEM;
} }

View file

@ -222,7 +222,7 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
struct locomo_dev *dev; struct locomo_dev *dev;
int ret; int ret;
dev = kzalloc_obj(struct locomo_dev, GFP_KERNEL); dev = kzalloc_obj(struct locomo_dev);
if (!dev) { if (!dev) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
@ -277,7 +277,7 @@ static int locomo_suspend(struct platform_device *dev, pm_message_t state)
struct locomo_save_data *save; struct locomo_save_data *save;
unsigned long flags; unsigned long flags;
save = kmalloc_obj(struct locomo_save_data, GFP_KERNEL); save = kmalloc_obj(struct locomo_save_data);
if (!save) if (!save)
return -ENOMEM; return -ENOMEM;
@ -360,7 +360,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
unsigned long r; unsigned long r;
int i, ret = -ENODEV; int i, ret = -ENODEV;
lchip = kzalloc_obj(struct locomo, GFP_KERNEL); lchip = kzalloc_obj(struct locomo);
if (!lchip) if (!lchip)
return -ENOMEM; return -ENOMEM;

View file

@ -737,7 +737,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
unsigned i; unsigned i;
int ret; int ret;
dev = kzalloc_obj(struct sa1111_dev, GFP_KERNEL); dev = kzalloc_obj(struct sa1111_dev);
if (!dev) { if (!dev) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_alloc; goto err_alloc;
@ -969,7 +969,7 @@ static int sa1111_suspend_noirq(struct device *dev)
unsigned int val; unsigned int val;
void __iomem *base; void __iomem *base;
save = kmalloc_obj(struct sa1111_save_data, GFP_KERNEL); save = kmalloc_obj(struct sa1111_save_data);
if (!save) if (!save)
return -ENOMEM; return -ENOMEM;
sachip->saved_state = save; sachip->saved_state = save;

View file

@ -185,7 +185,7 @@ static int scoop_probe(struct platform_device *pdev)
if (!mem) if (!mem)
return -EINVAL; return -EINVAL;
devptr = kzalloc_obj(struct scoop_dev, GFP_KERNEL); devptr = kzalloc_obj(struct scoop_dev);
if (!devptr) if (!devptr)
return -ENOMEM; return -ENOMEM;

View file

@ -108,7 +108,7 @@ static unsigned long get_arch_pgd(pgd_t *pgd)
static int secondary_biglittle_prepare(unsigned int cpu) static int secondary_biglittle_prepare(unsigned int cpu)
{ {
if (!cpu_vtable[cpu]) if (!cpu_vtable[cpu])
cpu_vtable[cpu] = kzalloc_obj(*cpu_vtable[cpu], GFP_KERNEL); cpu_vtable[cpu] = kzalloc_obj(*cpu_vtable[cpu]);
return cpu_vtable[cpu] ? 0 : -ENOMEM; return cpu_vtable[cpu] ? 0 : -ENOMEM;
} }

View file

@ -349,7 +349,7 @@ asmlinkage long sys_oabi_semtimedop(int semid,
return -E2BIG; return -E2BIG;
if (nsops < 1 || nsops > SEMOPM) if (nsops < 1 || nsops > SEMOPM)
return -EINVAL; return -EINVAL;
sops = kvmalloc_objs(*sops, nsops, GFP_KERNEL); sops = kvmalloc_objs(*sops, nsops);
if (!sops) if (!sops)
return -ENOMEM; return -ENOMEM;
err = 0; err = 0;

View file

@ -574,7 +574,7 @@ struct unwind_table *unwind_table_add(unsigned long start, unsigned long size,
unsigned long text_size) unsigned long text_size)
{ {
unsigned long flags; unsigned long flags;
struct unwind_table *tab = kmalloc_obj(*tab, GFP_KERNEL); struct unwind_table *tab = kmalloc_obj(*tab);
pr_debug("%s(%08lx, %08lx, %08lx, %08lx)\n", __func__, start, size, pr_debug("%s(%08lx, %08lx, %08lx, %08lx)\n", __func__, start, size,
text_addr, text_size); text_addr, text_size);

View file

@ -179,7 +179,7 @@ static int __init vdso_init(void)
text_pages = (vdso_end - vdso_start) >> PAGE_SHIFT; text_pages = (vdso_end - vdso_start) >> PAGE_SHIFT;
/* Allocate the VDSO text pagelist */ /* Allocate the VDSO text pagelist */
vdso_text_pagelist = kzalloc_objs(struct page *, text_pages, GFP_KERNEL); vdso_text_pagelist = kzalloc_objs(struct page *, text_pages);
if (vdso_text_pagelist == NULL) if (vdso_text_pagelist == NULL)
return -ENOMEM; return -ENOMEM;

View file

@ -262,7 +262,7 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys)
{ {
struct resource *res; struct resource *res;
res = kzalloc_objs(struct resource, 2, GFP_KERNEL); res = kzalloc_objs(struct resource, 2);
if (!res) { if (!res) {
printk("out of memory for root bus resources"); printk("out of memory for root bus resources");
return 0; return 0;

View file

@ -84,7 +84,7 @@ static int __init ebsa285_leds_init(void)
for (i = 0; i < ARRAY_SIZE(ebsa285_leds); i++) { for (i = 0; i < ARRAY_SIZE(ebsa285_leds); i++) {
struct ebsa285_led *led; struct ebsa285_led *led;
led = kzalloc_obj(*led, GFP_KERNEL); led = kzalloc_obj(*led);
if (!led) if (!led)
break; break;

View file

@ -727,7 +727,7 @@ static int __init netwinder_leds_init(void)
for (i = 0; i < ARRAY_SIZE(netwinder_leds); i++) { for (i = 0; i < ARRAY_SIZE(netwinder_leds); i++) {
struct netwinder_led *led; struct netwinder_led *led;
led = kzalloc_obj(*led, GFP_KERNEL); led = kzalloc_obj(*led);
if (!led) if (!led)
break; break;

View file

@ -477,7 +477,7 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b
char *name; char *name;
int ret; int ret;
pmu_mmdc = kzalloc_obj(*pmu_mmdc, GFP_KERNEL); pmu_mmdc = kzalloc_obj(*pmu_mmdc);
if (!pmu_mmdc) { if (!pmu_mmdc) {
pr_err("failed to allocate PMU device!\n"); pr_err("failed to allocate PMU device!\n");
return -ENOMEM; return -ENOMEM;

View file

@ -127,7 +127,7 @@ static void __init i2c_quirk(void)
for_each_compatible_node(np, NULL, "marvell,mv78230-i2c") { for_each_compatible_node(np, NULL, "marvell,mv78230-i2c") {
struct property *new_compat; struct property *new_compat;
new_compat = kzalloc_obj(*new_compat, GFP_KERNEL); new_compat = kzalloc_obj(*new_compat);
new_compat->name = kstrdup("compatible", GFP_KERNEL); new_compat->name = kstrdup("compatible", GFP_KERNEL);
new_compat->length = sizeof("marvell,mv78230-a0-i2c"); new_compat->length = sizeof("marvell,mv78230-a0-i2c");

View file

@ -190,7 +190,7 @@ static void __init armada_375_380_coherency_init(struct device_node *np)
for_each_compatible_node(cache_dn, NULL, "arm,pl310-cache") { for_each_compatible_node(cache_dn, NULL, "arm,pl310-cache") {
struct property *p; struct property *p;
p = kzalloc_obj(*p, GFP_KERNEL); p = kzalloc_obj(*p);
p->name = kstrdup("arm,io-coherent", GFP_KERNEL); p->name = kstrdup("arm,io-coherent", GFP_KERNEL);
of_add_property(cache_dn, p); of_add_property(cache_dn, p);
} }

View file

@ -154,7 +154,7 @@ static int __init mvebu_soc_device(void)
if (!is_id_valid) if (!is_id_valid)
return 0; return 0;
soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); soc_dev_attr = kzalloc_obj(*soc_dev_attr);
if (!soc_dev_attr) if (!soc_dev_attr)
return -ENOMEM; return -ENOMEM;

View file

@ -387,7 +387,7 @@ static void __init mxs_machine_init(void)
const u32 *ocotp = mxs_get_ocotp(); const u32 *ocotp = mxs_get_ocotp();
int ret; int ret;
soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); soc_dev_attr = kzalloc_obj(*soc_dev_attr);
if (!soc_dev_attr) if (!soc_dev_attr)
return; return;

View file

@ -319,7 +319,7 @@ static int __init omap1_system_dma_init(void)
goto exit_iounmap; goto exit_iounmap;
} }
d = kzalloc_obj(*d, GFP_KERNEL); d = kzalloc_obj(*d);
if (!d) { if (!d) {
ret = -ENOMEM; ret = -ENOMEM;
goto exit_iounmap; goto exit_iounmap;

View file

@ -125,7 +125,7 @@ static int __init omap1_dm_timer_init(void)
goto err_free_pdev; goto err_free_pdev;
} }
pdata = kzalloc_obj(*pdata, GFP_KERNEL); pdata = kzalloc_obj(*pdata);
if (!pdata) { if (!pdata) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_free_pdata; goto err_free_pdata;

View file

@ -237,7 +237,7 @@ void omap2xxx_clkt_vps_init(void)
omap2xxx_clkt_vps_late_init(); omap2xxx_clkt_vps_late_init();
omap2xxx_clkt_vps_check_bootloader_rates(); omap2xxx_clkt_vps_check_bootloader_rates();
hw = kzalloc_obj(*hw, GFP_KERNEL); hw = kzalloc_obj(*hw);
if (!hw) if (!hw)
return; return;
init.name = "virt_prcm_set"; init.name = "virt_prcm_set";

View file

@ -787,7 +787,7 @@ void __init omap_soc_device_init(void)
struct soc_device *soc_dev; struct soc_device *soc_dev;
struct soc_device_attribute *soc_dev_attr; struct soc_device_attribute *soc_dev_attr;
soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); soc_dev_attr = kzalloc_obj(*soc_dev_attr);
if (!soc_dev_attr) if (!soc_dev_attr)
return; return;

View file

@ -99,7 +99,7 @@ static struct powerdomain *_get_pwrdm(struct device *dev)
return NULL; return NULL;
} }
entry = kmalloc_obj(*entry, GFP_KERNEL); entry = kmalloc_obj(*entry);
if (entry) { if (entry) {
entry->dev = dev; entry->dev = dev;
entry->pwrdm = pwrdm; entry->pwrdm = pwrdm;

View file

@ -156,7 +156,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
!omap_hwmod_parse_module_range(NULL, node, &res)) !omap_hwmod_parse_module_range(NULL, node, &res))
return -ENODEV; return -ENODEV;
hwmods = kzalloc_objs(struct omap_hwmod *, oh_cnt, GFP_KERNEL); hwmods = kzalloc_objs(struct omap_hwmod *, oh_cnt);
if (!hwmods) { if (!hwmods) {
ret = -ENOMEM; ret = -ENOMEM;
goto odbfd_exit; goto odbfd_exit;
@ -309,7 +309,7 @@ static struct omap_device *omap_device_alloc(struct platform_device *pdev,
int i; int i;
struct omap_hwmod **hwmods; struct omap_hwmod **hwmods;
od = kzalloc_obj(struct omap_device, GFP_KERNEL); od = kzalloc_obj(struct omap_device);
if (!od) if (!od)
goto oda_exit1; goto oda_exit1;

View file

@ -3392,7 +3392,7 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh,
void __iomem *regs = NULL; void __iomem *regs = NULL;
unsigned long flags; unsigned long flags;
sysc = kzalloc_obj(*sysc, GFP_KERNEL); sysc = kzalloc_obj(*sysc);
if (!sysc) if (!sysc)
return -ENOMEM; return -ENOMEM;
@ -3422,7 +3422,7 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh,
} }
if (list_empty(&oh->slave_ports)) { if (list_empty(&oh->slave_ports)) {
oi = kzalloc_obj(*oi, GFP_KERNEL); oi = kzalloc_obj(*oi);
if (!oi) if (!oi)
goto out_free_class; goto out_free_class;
@ -3525,7 +3525,7 @@ int omap_hwmod_init_module(struct device *dev,
oh = _lookup(data->name); oh = _lookup(data->name);
if (!oh) { if (!oh) {
oh = kzalloc_obj(*oh, GFP_KERNEL); oh = kzalloc_obj(*oh);
if (!oh) if (!oh)
return -ENOMEM; return -ENOMEM;
@ -3536,7 +3536,7 @@ int omap_hwmod_init_module(struct device *dev,
/* Unused, can be handled by PRM driver handling resets */ /* Unused, can be handled by PRM driver handling resets */
oh->prcm.omap4.flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT; oh->prcm.omap4.flags = HWMOD_OMAP4_NO_CONTEXT_LOSS_BIT;
oh->class = kzalloc_obj(*oh->class, GFP_KERNEL); oh->class = kzalloc_obj(*oh->class);
if (!oh->class) { if (!oh->class) {
kfree(oh); kfree(oh);
return -ENOMEM; return -ENOMEM;

View file

@ -410,7 +410,7 @@ static int __init amx3_idle_init(struct device_node *cpu_node, int cpu)
state_count++; state_count++;
} }
idle_states = kzalloc_objs(*idle_states, state_count, GFP_KERNEL); idle_states = kzalloc_objs(*idle_states, state_count);
if (!idle_states) if (!idle_states)
return -ENOMEM; return -ENOMEM;

View file

@ -39,7 +39,7 @@ static void __init sr_set_nvalues(struct omap_volt_data *volt_data,
while (volt_data[count].volt_nominal) while (volt_data[count].volt_nominal)
count++; count++;
nvalue_table = kzalloc_objs(*nvalue_table, count, GFP_KERNEL); nvalue_table = kzalloc_objs(*nvalue_table, count);
if (!nvalue_table) if (!nvalue_table)
return; return;

View file

@ -169,7 +169,7 @@ static int __init pcie_setup(struct pci_sys_data *sys)
/* /*
* Request resources. * Request resources.
*/ */
res = kzalloc_obj(struct resource, GFP_KERNEL); res = kzalloc_obj(struct resource);
if (!res) if (!res)
panic("pcie_setup unable to alloc resources"); panic("pcie_setup unable to alloc resources");
@ -490,7 +490,7 @@ static int __init pci_setup(struct pci_sys_data *sys)
/* /*
* Request resources * Request resources
*/ */
res = kzalloc_obj(struct resource, GFP_KERNEL); res = kzalloc_obj(struct resource);
if (!res) if (!res)
panic("pci_setup unable to alloc resources"); panic("pci_setup unable to alloc resources");

View file

@ -692,7 +692,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
unsigned long base; unsigned long base;
int i; int i;
ec = kzalloc_obj(ecard_t, GFP_KERNEL); ec = kzalloc_obj(ecard_t);
if (!ec) { if (!ec) {
ec = ERR_PTR(-ENOMEM); ec = ERR_PTR(-ENOMEM);
goto nomem; goto nomem;

View file

@ -107,7 +107,7 @@ int __init sa11xx_clk_init(void)
clk_hw_register_clkdev(hw, "OSTIMER0", NULL); clk_hw_register_clkdev(hw, "OSTIMER0", NULL);
hw = kzalloc_obj(*hw, GFP_KERNEL); hw = kzalloc_obj(*hw);
if (!hw) if (!hw)
return -ENOMEM; return -ENOMEM;
hw->init = &clk_mpll_init_data; hw->init = &clk_mpll_init_data;
@ -129,7 +129,7 @@ int __init sa11xx_clk_init(void)
FAlnMsk(TUCR_TSEL), 0, &tucr_lock); FAlnMsk(TUCR_TSEL), 0, &tucr_lock);
clk_set_rate(hw->clk, 3686400); clk_set_rate(hw->clk, 3686400);
hw = kzalloc_obj(*hw, GFP_KERNEL); hw = kzalloc_obj(*hw);
if (!hw) if (!hw)
return -ENOMEM; return -ENOMEM;
hw->init = &clk_gpio27_init_data; hw->init = &clk_gpio27_init_data;

View file

@ -321,7 +321,7 @@ int __init sa11x0_register_fixed_regulator(int n,
{ {
struct regulator_init_data *id; struct regulator_init_data *id;
cfg->init_data = id = kzalloc_obj(*cfg->init_data, GFP_KERNEL); cfg->init_data = id = kzalloc_obj(*cfg->init_data);
if (!cfg->init_data) if (!cfg->init_data)
return -ENOMEM; return -ENOMEM;

View file

@ -276,7 +276,7 @@ static int neponset_probe(struct platform_device *dev)
goto err_alloc; goto err_alloc;
} }
d = kzalloc_obj(*d, GFP_KERNEL); d = kzalloc_obj(*d);
if (!d) { if (!d) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_alloc; goto err_alloc;

View file

@ -164,7 +164,7 @@ static int __init rcar_gen2_regulator_quirk(void)
if (ret) /* Skip invalid entry and continue */ if (ret) /* Skip invalid entry and continue */
continue; continue;
quirk = kzalloc_obj(*quirk, GFP_KERNEL); quirk = kzalloc_obj(*quirk);
if (!quirk) { if (!quirk) {
ret = -ENOMEM; ret = -ENOMEM;
of_node_put(np); of_node_put(np);

View file

@ -395,7 +395,7 @@ static int ve_spc_populate_opps(uint32_t cluster)
uint32_t data = 0, off, ret, idx; uint32_t data = 0, off, ret, idx;
struct ve_spc_opp *opps; struct ve_spc_opp *opps;
opps = kzalloc_objs(*opps, MAX_OPPS, GFP_KERNEL); opps = kzalloc_objs(*opps, MAX_OPPS);
if (!opps) if (!opps)
return -ENOMEM; return -ENOMEM;
@ -442,7 +442,7 @@ static int ve_init_opp_table(struct device *cpu_dev)
int __init ve_spc_init(void __iomem *baseaddr, u32 a15_clusid, int irq) int __init ve_spc_init(void __iomem *baseaddr, u32 a15_clusid, int irq)
{ {
int ret; int ret;
info = kzalloc_obj(*info, GFP_KERNEL); info = kzalloc_obj(*info);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
@ -525,7 +525,7 @@ static struct clk *ve_spc_clk_register(struct device *cpu_dev)
struct clk_init_data init; struct clk_init_data init;
struct clk_spc *spc; struct clk_spc *spc;
spc = kzalloc_obj(*spc, GFP_KERNEL); spc = kzalloc_obj(*spc);
if (!spc) if (!spc)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);

View file

@ -142,7 +142,7 @@ static void __init versatile_dt_pci_init(void)
goto out_put_node; goto out_put_node;
} }
newprop = kzalloc_obj(*newprop, GFP_KERNEL); newprop = kzalloc_obj(*newprop);
if (!newprop) if (!newprop)
goto out_put_node; goto out_put_node;

View file

@ -108,7 +108,7 @@ static void __init zynq_init_machine(void)
struct soc_device *soc_dev; struct soc_device *soc_dev;
struct device *parent = NULL; struct device *parent = NULL;
soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); soc_dev_attr = kzalloc_obj(*soc_dev_attr);
if (!soc_dev_attr) if (!soc_dev_attr)
goto out; goto out;

View file

@ -507,7 +507,7 @@ static __init int l2x0_pmu_init(void)
if (!l2x0_base) if (!l2x0_base)
return 0; return 0;
l2x0_pmu = kzalloc_obj(*l2x0_pmu, GFP_KERNEL); l2x0_pmu = kzalloc_obj(*l2x0_pmu);
if (!l2x0_pmu) { if (!l2x0_pmu) {
pr_warn("Unable to allocate L2x0 PMU\n"); pr_warn("Unable to allocate L2x0 PMU\n");
return -ENOMEM; return -ENOMEM;

View file

@ -342,7 +342,7 @@ static int __init __uniphier_cache_init(struct device_node *np,
return -EINVAL; return -EINVAL;
} }
data = kzalloc_obj(*data, GFP_KERNEL); data = kzalloc_obj(*data);
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;

View file

@ -1504,7 +1504,7 @@ arm_iommu_create_mapping(struct device *dev, dma_addr_t base, u64 size)
bitmap_size = PAGE_SIZE; bitmap_size = PAGE_SIZE;
} }
mapping = kzalloc_obj(struct dma_iommu_mapping, GFP_KERNEL); mapping = kzalloc_obj(struct dma_iommu_mapping);
if (!mapping) if (!mapping)
goto err; goto err;

View file

@ -339,7 +339,7 @@ int __init arch_xen_unpopulated_init(struct resource **res)
return -EINVAL; return -EINVAL;
} }
regs = kzalloc_objs(*regs, nr_reg, GFP_KERNEL); regs = kzalloc_objs(*regs, nr_reg);
if (!regs) { if (!regs) {
of_node_put(np); of_node_put(np);
return -ENOMEM; return -ENOMEM;
@ -383,7 +383,7 @@ int __init arch_xen_unpopulated_init(struct resource **res)
start = regs[i - 1].end + 1; start = regs[i - 1].end + 1;
end = regs[i].start - 1; end = regs[i].start - 1;
tmp_res = kzalloc_obj(*tmp_res, GFP_KERNEL); tmp_res = kzalloc_obj(*tmp_res);
if (!tmp_res) { if (!tmp_res) {
rc = -ENOMEM; rc = -ENOMEM;
goto err; goto err;

View file

@ -487,7 +487,7 @@ static int share_pfn_hyp(u64 pfn)
goto unlock; goto unlock;
} }
this = kzalloc_obj(*this, GFP_KERNEL); this = kzalloc_obj(*this);
if (!this) { if (!this) {
ret = -ENOMEM; ret = -ENOMEM;
goto unlock; goto unlock;
@ -2329,7 +2329,7 @@ int __init kvm_mmu_init(u32 hyp_va_bits)
goto out; goto out;
} }
hyp_pgtable = kzalloc_obj(*hyp_pgtable, GFP_KERNEL); hyp_pgtable = kzalloc_obj(*hyp_pgtable);
if (!hyp_pgtable) { if (!hyp_pgtable) {
kvm_err("Hyp mode page-table not allocated\n"); kvm_err("Hyp mode page-table not allocated\n");
err = -ENOMEM; err = -ENOMEM;

View file

@ -797,7 +797,7 @@ void kvm_host_pmu_init(struct arm_pmu *pmu)
guard(mutex)(&arm_pmus_lock); guard(mutex)(&arm_pmus_lock);
entry = kmalloc_obj(*entry, GFP_KERNEL); entry = kmalloc_obj(*entry);
if (!entry) if (!entry)
return; return;

View file

@ -104,7 +104,7 @@ static void *vgic_debug_start(struct seq_file *s, loff_t *pos)
struct kvm *kvm = s->private; struct kvm *kvm = s->private;
struct vgic_state_iter *iter; struct vgic_state_iter *iter;
iter = kmalloc_obj(*iter, GFP_KERNEL); iter = kmalloc_obj(*iter);
if (!iter) if (!iter)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
@ -375,7 +375,7 @@ static void *vgic_its_debug_start(struct seq_file *s, loff_t *pos)
if (!dev) if (!dev)
return NULL; return NULL;
iter = kmalloc_obj(*iter, GFP_KERNEL); iter = kmalloc_obj(*iter);
if (!iter) if (!iter)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);

View file

@ -654,7 +654,7 @@ static struct gic_kvm_info *gic_kvm_info;
void __init vgic_set_kvm_info(const struct gic_kvm_info *info) void __init vgic_set_kvm_info(const struct gic_kvm_info *info)
{ {
BUG_ON(gic_kvm_info != NULL); BUG_ON(gic_kvm_info != NULL);
gic_kvm_info = kmalloc_obj(*gic_kvm_info, GFP_KERNEL); gic_kvm_info = kmalloc_obj(*gic_kvm_info);
if (gic_kvm_info) if (gic_kvm_info)
*gic_kvm_info = *info; *gic_kvm_info = *info;
} }

View file

@ -2040,7 +2040,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
jit_data = prog->aux->jit_data; jit_data = prog->aux->jit_data;
if (!jit_data) { if (!jit_data) {
jit_data = kzalloc_obj(*jit_data, GFP_KERNEL); jit_data = kzalloc_obj(*jit_data);
if (!jit_data) { if (!jit_data) {
prog = orig_prog; prog = orig_prog;
goto out; goto out;
@ -2078,7 +2078,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
memset(&ctx, 0, sizeof(ctx)); memset(&ctx, 0, sizeof(ctx));
ctx.prog = prog; ctx.prog = prog;
ctx.offset = kvzalloc_objs(int, prog->len + 1, GFP_KERNEL); ctx.offset = kvzalloc_objs(int, prog->len + 1);
if (ctx.offset == NULL) { if (ctx.offset == NULL) {
prog = orig_prog; prog = orig_prog;
goto out_off; goto out_off;

View file

@ -20,7 +20,7 @@ static int __init vdso_init(void)
vdso_pages = (vdso_end - vdso_start) >> PAGE_SHIFT; vdso_pages = (vdso_end - vdso_start) >> PAGE_SHIFT;
vdso_pagelist = vdso_pagelist =
kzalloc_objs(struct page *, vdso_pages, GFP_KERNEL); kzalloc_objs(struct page *, vdso_pages);
if (unlikely(vdso_pagelist == NULL)) { if (unlikely(vdso_pagelist == NULL)) {
pr_err("vdso: pagelist allocation failed\n"); pr_err("vdso: pagelist allocation failed\n");
return -ENOMEM; return -ENOMEM;

View file

@ -622,7 +622,7 @@ static int kvm_eiointc_create(struct kvm_device *dev, u32 type)
if (kvm->arch.eiointc) if (kvm->arch.eiointc)
return -EINVAL; return -EINVAL;
s = kzalloc_obj(struct loongarch_eiointc, GFP_KERNEL); s = kzalloc_obj(struct loongarch_eiointc);
if (!s) if (!s)
return -ENOMEM; return -ENOMEM;

View file

@ -409,7 +409,7 @@ static int kvm_ipi_create(struct kvm_device *dev, u32 type)
return -EINVAL; return -EINVAL;
} }
s = kzalloc_obj(struct loongarch_ipi, GFP_KERNEL); s = kzalloc_obj(struct loongarch_ipi);
if (!s) if (!s)
return -ENOMEM; return -ENOMEM;

View file

@ -402,7 +402,7 @@ static int kvm_setup_default_irq_routing(struct kvm *kvm)
u32 nr = KVM_IRQCHIP_NUM_PINS; u32 nr = KVM_IRQCHIP_NUM_PINS;
struct kvm_irq_routing_entry *entries; struct kvm_irq_routing_entry *entries;
entries = kzalloc_objs(*entries, nr, GFP_KERNEL); entries = kzalloc_objs(*entries, nr);
if (!entries) if (!entries)
return -ENOMEM; return -ENOMEM;
@ -432,7 +432,7 @@ static int kvm_pch_pic_create(struct kvm_device *dev, u32 type)
if (ret) if (ret)
return -ENOMEM; return -ENOMEM;
s = kzalloc_obj(struct loongarch_pch_pic, GFP_KERNEL); s = kzalloc_obj(struct loongarch_pch_pic);
if (!s) if (!s)
return -ENOMEM; return -ENOMEM;

View file

@ -358,7 +358,7 @@ static int kvm_loongarch_env_init(void)
return -ENOMEM; return -ENOMEM;
} }
kvm_loongarch_ops = kzalloc_obj(*kvm_loongarch_ops, GFP_KERNEL); kvm_loongarch_ops = kzalloc_obj(*kvm_loongarch_ops);
if (!kvm_loongarch_ops) { if (!kvm_loongarch_ops) {
free_percpu(vmcs); free_percpu(vmcs);
vmcs = NULL; vmcs = NULL;

View file

@ -1547,7 +1547,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
vcpu->arch.handle_exit = kvm_handle_exit; vcpu->arch.handle_exit = kvm_handle_exit;
vcpu->arch.guest_eentry = (unsigned long)kvm_loongarch_ops->exc_entry; vcpu->arch.guest_eentry = (unsigned long)kvm_loongarch_ops->exc_entry;
vcpu->arch.csr = kzalloc_obj(struct loongarch_csrs, GFP_KERNEL); vcpu->arch.csr = kzalloc_obj(struct loongarch_csrs);
if (!vcpu->arch.csr) if (!vcpu->arch.csr)
return -ENOMEM; return -ENOMEM;

View file

@ -1943,7 +1943,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
jit_data = prog->aux->jit_data; jit_data = prog->aux->jit_data;
if (!jit_data) { if (!jit_data) {
jit_data = kzalloc_obj(*jit_data, GFP_KERNEL); jit_data = kzalloc_obj(*jit_data);
if (!jit_data) { if (!jit_data) {
prog = orig_prog; prog = orig_prog;
goto out; goto out;

View file

@ -101,7 +101,7 @@ static struct pci_config_window *arch_pci_ecam_create(struct device *dev,
if (busr->start > busr->end) if (busr->start > busr->end)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
cfg = kzalloc_obj(*cfg, GFP_KERNEL); cfg = kzalloc_obj(*cfg);
if (!cfg) if (!cfg)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
@ -199,13 +199,13 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
int domain = root->segment; int domain = root->segment;
int busnum = root->secondary.start; int busnum = root->secondary.start;
info = kzalloc_obj(*info, GFP_KERNEL); info = kzalloc_obj(*info);
if (!info) { if (!info) {
pr_warn("pci_bus %04x:%02x: ignored (out of memory)\n", domain, busnum); pr_warn("pci_bus %04x:%02x: ignored (out of memory)\n", domain, busnum);
return NULL; return NULL;
} }
root_ops = kzalloc_obj(*root_ops, GFP_KERNEL); root_ops = kzalloc_obj(*root_ops);
if (!root_ops) { if (!root_ops) {
kfree(info); kfree(info);
return NULL; return NULL;

View file

@ -47,7 +47,7 @@ void *amiga_chip_alloc(unsigned long size, const char *name)
struct resource *res; struct resource *res;
void *p; void *p;
res = kzalloc_obj(struct resource, GFP_KERNEL); res = kzalloc_obj(struct resource);
if (!res) if (!res)
return NULL; return NULL;

View file

@ -161,7 +161,7 @@ void *atari_stram_alloc(unsigned long size, const char *owner)
/* round up */ /* round up */
size = PAGE_ALIGN(size); size = PAGE_ALIGN(size);
res = kzalloc_obj(struct resource, GFP_KERNEL); res = kzalloc_obj(struct resource);
if (!res) if (!res)
return NULL; return NULL;

View file

@ -112,7 +112,7 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
return -EINVAL; return -EINVAL;
} }
dev = kmalloc_obj(struct nfhd_device, GFP_KERNEL); dev = kmalloc_obj(struct nfhd_device);
if (!dev) if (!dev)
goto out; goto out;

View file

@ -110,7 +110,7 @@ static struct vm_struct *get_io_area(unsigned long size)
unsigned long addr; unsigned long addr;
struct vm_struct **p, *tmp, *area; struct vm_struct **p, *tmp, *area;
area = kmalloc_obj(*area, GFP_KERNEL); area = kmalloc_obj(*area);
if (!area) if (!area)
return NULL; return NULL;
addr = KMAP_START; addr = KMAP_START;

View file

@ -154,7 +154,7 @@ static struct clk __init *alchemy_clk_setup_cpu(const char *parent_name,
struct clk_hw *h; struct clk_hw *h;
struct clk *clk; struct clk *clk;
h = kzalloc_obj(*h, GFP_KERNEL); h = kzalloc_obj(*h);
if (!h) if (!h)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
@ -249,7 +249,7 @@ static struct clk __init *alchemy_clk_setup_aux(const char *parent_name,
struct clk *c; struct clk *c;
struct alchemy_auxpll_clk *a; struct alchemy_auxpll_clk *a;
a = kzalloc_obj(*a, GFP_KERNEL); a = kzalloc_obj(*a);
if (!a) if (!a)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
@ -775,7 +775,7 @@ static int __init alchemy_clk_init_fgens(int ctype)
} }
id.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE; id.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE;
a = kzalloc_objs(*a, 6, GFP_KERNEL); a = kzalloc_objs(*a, 6);
if (!a) if (!a)
return -ENOMEM; return -ENOMEM;
@ -996,7 +996,7 @@ static int __init alchemy_clk_setup_imux(int ctype)
return -ENODEV; return -ENODEV;
} }
a = kzalloc_objs(*a, 6, GFP_KERNEL); a = kzalloc_objs(*a, 6);
if (!a) if (!a)
return -ENOMEM; return -ENOMEM;

View file

@ -1057,7 +1057,7 @@ static int __init dbdma_setup(unsigned int irq, dbdev_tab_t *idtable)
{ {
int ret; int ret;
dbdev_tab = kzalloc_objs(dbdev_tab_t, DBDEV_TAB_SIZE, GFP_KERNEL); dbdev_tab = kzalloc_objs(dbdev_tab_t, DBDEV_TAB_SIZE);
if (!dbdev_tab) if (!dbdev_tab)
return -ENOMEM; return -ENOMEM;

View file

@ -202,10 +202,10 @@ static unsigned long alchemy_ehci_data[][2] __initdata = {
static int __init _new_usbres(struct resource **r, struct platform_device **d) static int __init _new_usbres(struct resource **r, struct platform_device **d)
{ {
*r = kzalloc_objs(struct resource, 2, GFP_KERNEL); *r = kzalloc_objs(struct resource, 2);
if (!*r) if (!*r)
return -ENOMEM; return -ENOMEM;
*d = kzalloc_obj(struct platform_device, GFP_KERNEL); *d = kzalloc_obj(struct platform_device);
if (!*d) { if (!*d) {
kfree(*r); kfree(*r);
return -ENOMEM; return -ENOMEM;

View file

@ -87,7 +87,7 @@ int __init db1x_register_pcmcia_socket(phys_addr_t pcmcia_attr_start,
if (stschg_irq) if (stschg_irq)
cnt++; cnt++;
sr = kzalloc_objs(struct resource, cnt, GFP_KERNEL); sr = kzalloc_objs(struct resource, cnt);
if (!sr) if (!sr)
return -ENOMEM; return -ENOMEM;
@ -162,15 +162,15 @@ int __init db1x_register_norflash(unsigned long size, int width,
return -EINVAL; return -EINVAL;
ret = -ENOMEM; ret = -ENOMEM;
parts = kzalloc_objs(struct mtd_partition, 5, GFP_KERNEL); parts = kzalloc_objs(struct mtd_partition, 5);
if (!parts) if (!parts)
goto out; goto out;
res = kzalloc_obj(struct resource, GFP_KERNEL); res = kzalloc_obj(struct resource);
if (!res) if (!res)
goto out1; goto out1;
pfd = kzalloc_obj(struct physmap_flash_data, GFP_KERNEL); pfd = kzalloc_obj(struct physmap_flash_data);
if (!pfd) if (!pfd)
goto out2; goto out2;

View file

@ -187,7 +187,7 @@ static struct device * __init bcm47xx_setup_device(void)
struct device *dev; struct device *dev;
int err; int err;
dev = kzalloc_obj(*dev, GFP_KERNEL); dev = kzalloc_obj(*dev);
if (!dev) if (!dev)
return NULL; return NULL;

View file

@ -100,7 +100,7 @@ static int octeon_irq_set_ciu_mapping(int irq, int line, int bit, int gpio_line,
{ {
struct octeon_ciu_chip_data *cd; struct octeon_ciu_chip_data *cd;
cd = kzalloc_obj(*cd, GFP_KERNEL); cd = kzalloc_obj(*cd);
if (!cd) if (!cd)
return -ENOMEM; return -ENOMEM;
@ -1462,7 +1462,7 @@ static int __init octeon_irq_init_ciu(
struct irq_domain *ciu_domain = NULL; struct irq_domain *ciu_domain = NULL;
struct octeon_irq_ciu_domain_data *dd; struct octeon_irq_ciu_domain_data *dd;
dd = kzalloc_obj(*dd, GFP_KERNEL); dd = kzalloc_obj(*dd);
if (!dd) if (!dd)
return -ENOMEM; return -ENOMEM;
@ -1633,7 +1633,7 @@ static int __init octeon_irq_init_gpio(
return -EINVAL; return -EINVAL;
} }
gpiod = kzalloc_obj(*gpiod, GFP_KERNEL); gpiod = kzalloc_obj(*gpiod);
if (gpiod) { if (gpiod) {
/* gpio domain host_data is the base hwirq number. */ /* gpio domain host_data is the base hwirq number. */
gpiod->base_hwirq = base_hwirq; gpiod->base_hwirq = base_hwirq;
@ -2223,7 +2223,7 @@ static int octeon_irq_cib_map(struct irq_domain *d,
return -EINVAL; return -EINVAL;
} }
cd = kzalloc_obj(*cd, GFP_KERNEL); cd = kzalloc_obj(*cd);
if (!cd) if (!cd)
return -ENOMEM; return -ENOMEM;
@ -2304,7 +2304,7 @@ static int __init octeon_irq_init_cib(struct device_node *ciu_node,
return -EINVAL; return -EINVAL;
} }
host_data = kzalloc_obj(*host_data, GFP_KERNEL); host_data = kzalloc_obj(*host_data);
if (!host_data) if (!host_data)
return -ENOMEM; return -ENOMEM;
raw_spin_lock_init(&host_data->lock); raw_spin_lock_init(&host_data->lock);

View file

@ -72,7 +72,7 @@ static int apply_r_mips_hi16(struct module *me, u32 *location, Elf_Addr v,
* the carry we need to add. Save the information, and let LO16 do the * the carry we need to add. Save the information, and let LO16 do the
* actual relocation. * actual relocation.
*/ */
n = kmalloc_obj(*n, GFP_KERNEL); n = kmalloc_obj(*n);
if (!n) if (!n)
return -ENOMEM; return -ENOMEM;

View file

@ -352,7 +352,7 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
for (cl = 0; cl < nclusters; cl++) { for (cl = 0; cl < nclusters; cl++) {
/* Allocate core boot configuration structs */ /* Allocate core boot configuration structs */
ncores = mips_cps_numcores(cl); ncores = mips_cps_numcores(cl);
core_bootcfg = kzalloc_objs(*core_bootcfg, ncores, GFP_KERNEL); core_bootcfg = kzalloc_objs(*core_bootcfg, ncores);
if (!core_bootcfg) if (!core_bootcfg)
goto err_out; goto err_out;
mips_cps_cluster_bootcfg[cl].core_config = core_bootcfg; mips_cps_cluster_bootcfg[cl].core_config = core_bootcfg;

View file

@ -94,7 +94,7 @@ struct vpe *alloc_vpe(int minor)
{ {
struct vpe *v; struct vpe *v;
v = kzalloc_obj(struct vpe, GFP_KERNEL); v = kzalloc_obj(struct vpe);
if (v == NULL) if (v == NULL)
goto out; goto out;
@ -115,7 +115,7 @@ struct tc *alloc_tc(int index)
{ {
struct tc *tc; struct tc *tc;
tc = kzalloc_obj(struct tc, GFP_KERNEL); tc = kzalloc_obj(struct tc);
if (tc == NULL) if (tc == NULL)
goto out; goto out;
@ -318,7 +318,7 @@ static int apply_r_mips_hi16(struct module *me, uint32_t *location,
* the carry we need to add. Save the information, and let LO16 do the * the carry we need to add. Save the information, and let LO16 do the
* actual relocation. * actual relocation.
*/ */
n = kmalloc_obj(*n, GFP_KERNEL); n = kmalloc_obj(*n);
if (!n) if (!n)
return -ENOMEM; return -ENOMEM;

View file

@ -161,7 +161,7 @@ static void falcon_gpe_enable(void)
static inline void clkdev_add_sys(const char *dev, unsigned int module, static inline void clkdev_add_sys(const char *dev, unsigned int module,
unsigned int bits) unsigned int bits)
{ {
struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL); struct clk *clk = kzalloc_obj(struct clk);
if (!clk) if (!clk)
return; return;

View file

@ -121,7 +121,7 @@ static void gptu_disable(struct clk *clk)
static inline void clkdev_add_gptu(struct device *dev, const char *con, static inline void clkdev_add_gptu(struct device *dev, const char *con,
unsigned int timer) unsigned int timer)
{ {
struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL); struct clk *clk = kzalloc_obj(struct clk);
if (!clk) if (!clk)
return; return;

View file

@ -331,7 +331,7 @@ static int clkout_enable(struct clk *clk)
static void clkdev_add_pmu(const char *dev, const char *con, bool deactivate, static void clkdev_add_pmu(const char *dev, const char *con, bool deactivate,
unsigned int module, unsigned int bits) unsigned int module, unsigned int bits)
{ {
struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL); struct clk *clk = kzalloc_obj(struct clk);
if (!clk) if (!clk)
return; return;
@ -356,7 +356,7 @@ static void clkdev_add_pmu(const char *dev, const char *con, bool deactivate,
static void clkdev_add_cgu(const char *dev, const char *con, static void clkdev_add_cgu(const char *dev, const char *con,
unsigned int bits) unsigned int bits)
{ {
struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL); struct clk *clk = kzalloc_obj(struct clk);
if (!clk) if (!clk)
return; return;
@ -374,8 +374,8 @@ static unsigned long valid_pci_rates[] = {CLOCK_33M, CLOCK_62_5M, 0};
static void clkdev_add_pci(void) static void clkdev_add_pci(void)
{ {
struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL); struct clk *clk = kzalloc_obj(struct clk);
struct clk *clk_ext = kzalloc_obj(struct clk, GFP_KERNEL); struct clk *clk_ext = kzalloc_obj(struct clk);
/* main pci clock */ /* main pci clock */
if (clk) { if (clk) {
@ -423,7 +423,7 @@ static void clkdev_add_clkout(void)
continue; continue;
sprintf(name, "clkout%d", i); sprintf(name, "clkout%d", i);
clk = kzalloc_obj(struct clk, GFP_KERNEL); clk = kzalloc_obj(struct clk);
if (!clk) { if (!clk) {
kfree(name); kfree(name);
continue; continue;

View file

@ -380,7 +380,7 @@ static int alchemy_pci_probe(struct platform_device *pdev)
goto out; goto out;
} }
ctx = kzalloc_obj(*ctx, GFP_KERNEL); ctx = kzalloc_obj(*ctx);
if (!ctx) { if (!ctx) {
dev_err(&pdev->dev, "no memory for pcictl context\n"); dev_err(&pdev->dev, "no memory for pcictl context\n");
ret = -ENOMEM; ret = -ENOMEM;

View file

@ -341,7 +341,7 @@ static int bridge_domain_alloc(struct irq_domain *domain, unsigned int virq,
if (nr_irqs > 1 || !info) if (nr_irqs > 1 || !info)
return -EINVAL; return -EINVAL;
data = kzalloc_obj(*data, GFP_KERNEL); data = kzalloc_obj(*data);
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;

View file

@ -198,7 +198,7 @@ static int __init mt7620_soc_dev_init(void)
struct soc_device *soc_dev; struct soc_device *soc_dev;
struct soc_device_attribute *soc_dev_attr; struct soc_device_attribute *soc_dev_attr;
soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); soc_dev_attr = kzalloc_obj(*soc_dev_attr);
if (!soc_dev_attr) if (!soc_dev_attr)
return -ENOMEM; return -ENOMEM;

View file

@ -144,7 +144,7 @@ static int __init mt7621_soc_dev_init(void)
struct soc_device *soc_dev; struct soc_device *soc_dev;
struct soc_device_attribute *soc_dev_attr; struct soc_device_attribute *soc_dev_attr;
soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); soc_dev_attr = kzalloc_obj(*soc_dev_attr);
if (!soc_dev_attr) if (!soc_dev_attr)
return -ENOMEM; return -ENOMEM;

View file

@ -68,7 +68,7 @@ static int __init rt2880_soc_dev_init(void)
struct soc_device *soc_dev; struct soc_device *soc_dev;
struct soc_device_attribute *soc_dev_attr; struct soc_device_attribute *soc_dev_attr;
soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); soc_dev_attr = kzalloc_obj(*soc_dev_attr);
if (!soc_dev_attr) if (!soc_dev_attr)
return -ENOMEM; return -ENOMEM;

View file

@ -171,7 +171,7 @@ static int __init rt305x_soc_dev_init(void)
struct soc_device *soc_dev; struct soc_device *soc_dev;
struct soc_device_attribute *soc_dev_attr; struct soc_device_attribute *soc_dev_attr;
soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); soc_dev_attr = kzalloc_obj(*soc_dev_attr);
if (!soc_dev_attr) if (!soc_dev_attr)
return -ENOMEM; return -ENOMEM;

View file

@ -68,7 +68,7 @@ static int __init rt3883_soc_dev_init(void)
struct soc_device *soc_dev; struct soc_device *soc_dev;
struct soc_device_attribute *soc_dev_attr; struct soc_device_attribute *soc_dev_attr;
soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); soc_dev_attr = kzalloc_obj(*soc_dev_attr);
if (!soc_dev_attr) if (!soc_dev_attr)
return -ENOMEM; return -ENOMEM;

View file

@ -361,7 +361,7 @@ static void ip22_check_gio(int slotno, unsigned long addr, int irq)
} }
printk(KERN_INFO "GIO: slot %d : %s (id %x)\n", printk(KERN_INFO "GIO: slot %d : %s (id %x)\n",
slotno, name, id); slotno, name, id);
gio_dev = kzalloc_obj(*gio_dev, GFP_KERNEL); gio_dev = kzalloc_obj(*gio_dev);
if (!gio_dev) if (!gio_dev)
return; return;
gio_dev->name = name; gio_dev->name = name;

View file

@ -129,7 +129,7 @@ static int hub_domain_alloc(struct irq_domain *domain, unsigned int virq,
if (nr_irqs > 1 || !info) if (nr_irqs > 1 || !info)
return -EINVAL; return -EINVAL;
hd = kzalloc_obj(*hd, GFP_KERNEL); hd = kzalloc_obj(*hd);
if (!hd) if (!hd)
return -ENOMEM; return -ENOMEM;

View file

@ -34,7 +34,7 @@ static void bridge_platform_create(nasid_t nasid, int widget, int masterwid)
offset = NODE_OFFSET(nasid); offset = NODE_OFFSET(nasid);
wd = kzalloc_obj(*wd, GFP_KERNEL); wd = kzalloc_obj(*wd);
if (!wd) { if (!wd) {
pr_warn("xtalk:n%d/%x bridge create out of memory\n", nasid, widget); pr_warn("xtalk:n%d/%x bridge create out of memory\n", nasid, widget);
return; return;
@ -69,7 +69,7 @@ static void bridge_platform_create(nasid_t nasid, int widget, int masterwid)
/* platform_device_add_data() duplicates the data */ /* platform_device_add_data() duplicates the data */
kfree(wd); kfree(wd);
bd = kzalloc_obj(*bd, GFP_KERNEL); bd = kzalloc_obj(*bd);
if (!bd) { if (!bd) {
pr_warn("xtalk:n%d/%x bridge create out of memory\n", nasid, widget); pr_warn("xtalk:n%d/%x bridge create out of memory\n", nasid, widget);
goto err_unregister_pdev_wd; goto err_unregister_pdev_wd;

View file

@ -209,7 +209,7 @@ static int heart_domain_alloc(struct irq_domain *domain, unsigned int virq,
if (nr_irqs > 1 || !info) if (nr_irqs > 1 || !info)
return -EINVAL; return -EINVAL;
hd = kzalloc_obj(*hd, GFP_KERNEL); hd = kzalloc_obj(*hd);
if (!hd) if (!hd)
return -ENOMEM; return -ENOMEM;

View file

@ -44,7 +44,7 @@ static void bridge_platform_create(int widget, int masterwid)
struct platform_device *pdev_bd; struct platform_device *pdev_bd;
struct resource w1_res; struct resource w1_res;
wd = kzalloc_obj(*wd, GFP_KERNEL); wd = kzalloc_obj(*wd);
if (!wd) { if (!wd) {
pr_warn("xtalk:%x bridge create out of memory\n", widget); pr_warn("xtalk:%x bridge create out of memory\n", widget);
return; return;
@ -79,7 +79,7 @@ static void bridge_platform_create(int widget, int masterwid)
/* platform_device_add_data() duplicates the data */ /* platform_device_add_data() duplicates the data */
kfree(wd); kfree(wd);
bd = kzalloc_obj(*bd, GFP_KERNEL); bd = kzalloc_obj(*bd);
if (!bd) { if (!bd) {
pr_warn("xtalk:%x bridge create out of memory\n", widget); pr_warn("xtalk:%x bridge create out of memory\n", widget);
goto err_unregister_pdev_wd; goto err_unregister_pdev_wd;

View file

@ -120,7 +120,7 @@ txx9_alloc_pci_controller(struct pci_controller *pcic,
int min_size = 0x10000; int min_size = 0x10000;
if (!pcic) { if (!pcic) {
new = kzalloc_obj(*new, GFP_KERNEL); new = kzalloc_obj(*new);
if (!new) if (!new)
return NULL; return NULL;
new->r_mem[0].name = "PCI mem"; new->r_mem[0].name = "PCI mem";

View file

@ -648,7 +648,7 @@ void __init txx9_iocled_init(unsigned long baseaddr,
if (!deftriggers) if (!deftriggers)
deftriggers = default_triggers; deftriggers = default_triggers;
iocled = kzalloc_obj(*iocled, GFP_KERNEL); iocled = kzalloc_obj(*iocled);
if (!iocled) if (!iocled)
return; return;
iocled->mmioaddr = ioremap(baseaddr, 1); iocled->mmioaddr = ioremap(baseaddr, 1);
@ -822,7 +822,7 @@ void __init txx9_sramc_init(struct resource *r)
err = subsys_system_register(&txx9_sramc_subsys, NULL); err = subsys_system_register(&txx9_sramc_subsys, NULL);
if (err) if (err)
return; return;
dev = kzalloc_obj(*dev, GFP_KERNEL); dev = kzalloc_obj(*dev);
if (!dev) if (!dev)
return; return;
size = resource_size(r); size = resource_size(r);

View file

@ -28,7 +28,7 @@ static int __init nios2_soc_device_init(void)
struct soc_device_attribute *soc_dev_attr; struct soc_device_attribute *soc_dev_attr;
const char *machine; const char *machine;
soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL); soc_dev_attr = kzalloc_obj(*soc_dev_attr);
if (soc_dev_attr) { if (soc_dev_attr) {
machine = of_flat_dt_get_machine_name(); machine = of_flat_dt_get_machine_name();
if (machine) if (machine)

View file

@ -418,7 +418,7 @@ static void setup_bus_id(struct parisc_device *padev)
static struct parisc_device * __init create_tree_node(char id, static struct parisc_device * __init create_tree_node(char id,
struct device *parent) struct device *parent)
{ {
struct parisc_device *dev = kzalloc_obj(*dev, GFP_KERNEL); struct parisc_device *dev = kzalloc_obj(*dev);
if (!dev) if (!dev)
return NULL; return NULL;

View file

@ -193,7 +193,7 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
long status; /* PDC return value status */ long status; /* PDC return value status */
struct parisc_device *dev; struct parisc_device *dev;
pa_pdc_cell = kmalloc_obj(*pa_pdc_cell, GFP_KERNEL); pa_pdc_cell = kmalloc_obj(*pa_pdc_cell);
if (!pa_pdc_cell) if (!pa_pdc_cell)
panic("couldn't allocate memory for PDC_PAT_CELL!"); panic("couldn't allocate memory for PDC_PAT_CELL!");
@ -536,7 +536,7 @@ add_system_map_addresses(struct parisc_device *dev, int num_addrs,
long status; long status;
struct pdc_system_map_addr_info addr_result; struct pdc_system_map_addr_info addr_result;
dev->addr = kmalloc_objs(*dev->addr, num_addrs, GFP_KERNEL); dev->addr = kmalloc_objs(*dev->addr, num_addrs);
if(!dev->addr) { if(!dev->addr) {
printk(KERN_ERR "%s %s(): memory allocation failure\n", printk(KERN_ERR "%s %s(): memory allocation failure\n",
__FILE__, __func__); __FILE__, __func__);

View file

@ -110,7 +110,7 @@ static int __init processor_probe(struct parisc_device *dev)
unsigned long bytecnt; unsigned long bytecnt;
pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell; pdc_pat_cell_mod_maddr_block_t *pa_pdc_cell;
pa_pdc_cell = kmalloc_obj(*pa_pdc_cell, GFP_KERNEL); pa_pdc_cell = kmalloc_obj(*pa_pdc_cell);
if (!pa_pdc_cell) if (!pa_pdc_cell)
panic("couldn't allocate memory for PDC_PAT_CELL!"); panic("couldn't allocate memory for PDC_PAT_CELL!");

View file

@ -102,7 +102,7 @@ static struct page ** __init vdso_setup_pages(void *start, void *end)
struct page **pagelist; struct page **pagelist;
int i; int i;
pagelist = kzalloc_objs(struct page *, pages + 1, GFP_KERNEL); pagelist = kzalloc_objs(struct page *, pages + 1);
if (!pagelist) if (!pagelist)
panic("%s: Cannot allocate page list for VDSO", __func__); panic("%s: Cannot allocate page list for VDSO", __func__);
for (i = 0; i < pages; i++) for (i = 0; i < pages; i++)

View file

@ -63,7 +63,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
jit_data = prog->aux->jit_data; jit_data = prog->aux->jit_data;
if (!jit_data) { if (!jit_data) {
jit_data = kzalloc_obj(*jit_data, GFP_KERNEL); jit_data = kzalloc_obj(*jit_data);
if (!jit_data) { if (!jit_data) {
prog = orig_prog; prog = orig_prog;
goto out; goto out;
@ -80,7 +80,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
} }
ctx->prog = prog; ctx->prog = prog;
ctx->offset = kzalloc_objs(int, prog->len, GFP_KERNEL); ctx->offset = kzalloc_objs(int, prog->len);
if (!ctx->offset) { if (!ctx->offset) {
prog = orig_prog; prog = orig_prog;
goto out_offset; goto out_offset;

View file

@ -157,7 +157,7 @@ static struct cache *new_cache(int type, int level,
{ {
struct cache *cache; struct cache *cache;
cache = kzalloc_obj(*cache, GFP_KERNEL); cache = kzalloc_obj(*cache);
if (cache) if (cache)
cache_init(cache, type, level, ofnode, group_id); cache_init(cache, type, level, ofnode, group_id);
@ -540,7 +540,7 @@ static struct cache_dir *cacheinfo_create_cache_dir(unsigned int cpu_id)
if (!kobj) if (!kobj)
goto err; goto err;
cache_dir = kzalloc_obj(*cache_dir, GFP_KERNEL); cache_dir = kzalloc_obj(*cache_dir);
if (!cache_dir) if (!cache_dir)
goto err; goto err;
@ -788,7 +788,7 @@ static void cacheinfo_create_index_dir(struct cache *cache, int index,
struct cache_index_dir *index_dir; struct cache_index_dir *index_dir;
int rc; int rc;
index_dir = kzalloc_obj(*index_dir, GFP_KERNEL); index_dir = kzalloc_obj(*index_dir);
if (!index_dir) if (!index_dir)
return; return;

View file

@ -890,7 +890,7 @@ loff_t __init nvram_create_partition(const char *name, int sig,
return -ENOSPC; return -ENOSPC;
/* Create our OS partition */ /* Create our OS partition */
new_part = kzalloc_obj(*new_part, GFP_KERNEL); new_part = kzalloc_obj(*new_part);
if (!new_part) { if (!new_part) {
pr_err("%s: kmalloc failed\n", __func__); pr_err("%s: kmalloc failed\n", __func__);
return -ENOMEM; return -ENOMEM;
@ -1030,7 +1030,7 @@ int __init nvram_scan_partitions(void)
"detected: 0-length partition\n"); "detected: 0-length partition\n");
goto out; goto out;
} }
tmp_part = kmalloc_obj(*tmp_part, GFP_KERNEL); tmp_part = kmalloc_obj(*tmp_part);
err = -ENOMEM; err = -ENOMEM;
if (!tmp_part) { if (!tmp_part) {
printk(KERN_ERR "nvram_scan_partitions: kmalloc failed\n"); printk(KERN_ERR "nvram_scan_partitions: kmalloc failed\n");

View file

@ -125,7 +125,7 @@ struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
{ {
struct pci_controller *phb; struct pci_controller *phb;
phb = kzalloc_obj(struct pci_controller, GFP_KERNEL); phb = kzalloc_obj(struct pci_controller);
if (phb == NULL) if (phb == NULL)
return NULL; return NULL;
@ -432,7 +432,7 @@ static int pci_read_irq_line(struct pci_dev *pci_dev)
struct pci_intx_virq *vi, *vitmp; struct pci_intx_virq *vi, *vitmp;
/* Preallocate vi as rewind is complex if this fails after mapping */ /* Preallocate vi as rewind is complex if this fails after mapping */
vi = kzalloc_obj(struct pci_intx_virq, GFP_KERNEL); vi = kzalloc_obj(struct pci_intx_virq);
if (!vi) if (!vi)
return -1; return -1;
@ -1368,7 +1368,7 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus)
if (!(hose->io_resource.flags & IORESOURCE_IO)) if (!(hose->io_resource.flags & IORESOURCE_IO))
goto no_io; goto no_io;
offset = (unsigned long)hose->io_base_virt - _IO_BASE; offset = (unsigned long)hose->io_base_virt - _IO_BASE;
res = kzalloc_obj(struct resource, GFP_KERNEL); res = kzalloc_obj(struct resource);
BUG_ON(res == NULL); BUG_ON(res == NULL);
res->name = "Legacy IO"; res->name = "Legacy IO";
res->flags = IORESOURCE_IO; res->flags = IORESOURCE_IO;
@ -1396,7 +1396,7 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus)
} }
if (i >= 3) if (i >= 3)
return; return;
res = kzalloc_obj(struct resource, GFP_KERNEL); res = kzalloc_obj(struct resource);
BUG_ON(res == NULL); BUG_ON(res == NULL);
res->name = "Legacy VGA memory"; res->name = "Legacy VGA memory";
res->flags = IORESOURCE_MEM; res->flags = IORESOURCE_MEM;

View file

@ -130,7 +130,7 @@ static struct eeh_dev *eeh_dev_init(struct pci_dn *pdn)
struct eeh_dev *edev; struct eeh_dev *edev;
/* Allocate EEH device */ /* Allocate EEH device */
edev = kzalloc_obj(*edev, GFP_KERNEL); edev = kzalloc_obj(*edev);
if (!edev) if (!edev)
return NULL; return NULL;
@ -154,7 +154,7 @@ static struct pci_dn *add_one_sriov_vf_pdn(struct pci_dn *parent,
if (!parent) if (!parent)
return NULL; return NULL;
pdn = kzalloc_obj(*pdn, GFP_KERNEL); pdn = kzalloc_obj(*pdn);
if (!pdn) if (!pdn)
return NULL; return NULL;
@ -290,7 +290,7 @@ struct pci_dn *pci_add_device_node_info(struct pci_controller *hose,
struct eeh_dev *edev; struct eeh_dev *edev;
#endif #endif
pdn = kzalloc_obj(*pdn, GFP_KERNEL); pdn = kzalloc_obj(*pdn);
if (pdn == NULL) if (pdn == NULL)
return NULL; return NULL;
dn->data = pdn; dn->data = pdn;

View file

@ -151,7 +151,7 @@ static __init int add_var(const char *name)
struct kobject *kobj; struct kobject *kobj;
int rc; int rc;
kobj = kzalloc_obj(*kobj, GFP_KERNEL); kobj = kzalloc_obj(*kobj);
if (!kobj) if (!kobj)
return -ENOMEM; return -ENOMEM;

View file

@ -117,7 +117,7 @@ void smp_generic_give_timebase(void)
pr_debug("Software timebase sync\n"); pr_debug("Software timebase sync\n");
/* if this fails then this kernel won't work anyway... */ /* if this fails then this kernel won't work anyway... */
tbsync = kzalloc_obj(*tbsync, GFP_KERNEL); tbsync = kzalloc_obj(*tbsync);
mb(); mb();
running = 1; running = 1;

View file

@ -1172,7 +1172,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
* Assumption: if boot_cpuid doesn't have a chip-id, then no * Assumption: if boot_cpuid doesn't have a chip-id, then no
* other CPUs, will also not have chip-id. * other CPUs, will also not have chip-id.
*/ */
chip_id_lookup_table = kzalloc_objs(int, idx, GFP_KERNEL); chip_id_lookup_table = kzalloc_objs(int, idx);
if (chip_id_lookup_table) if (chip_id_lookup_table)
memset(chip_id_lookup_table, -1, sizeof(int) * idx); memset(chip_id_lookup_table, -1, sizeof(int) * idx);
} }

Some files were not shown because too many files have changed in this diff Show more