mirror of
https://github.com/torvalds/linux.git
synced 2026-03-07 23:04:33 +01:00
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:
parent
e19e1b480a
commit
bf4afc53b7
6673 changed files with 13013 additions and 13013 deletions
|
|
@ -861,7 +861,7 @@ marvel_agp_setup(alpha_agp_info *agp)
|
|||
if (!alpha_agpgart_size)
|
||||
return -ENOMEM;
|
||||
|
||||
aper = kmalloc_obj(*aper, GFP_KERNEL);
|
||||
aper = kmalloc_obj(*aper);
|
||||
if (aper == NULL) return -ENOMEM;
|
||||
|
||||
aper->arena = agp->hose->sg_pci;
|
||||
|
|
@ -1059,7 +1059,7 @@ marvel_agp_info(void)
|
|||
/*
|
||||
* Allocate the info structure.
|
||||
*/
|
||||
agp = kmalloc_obj(*agp, GFP_KERNEL);
|
||||
agp = kmalloc_obj(*agp);
|
||||
if (!agp)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -594,7 +594,7 @@ titan_agp_setup(alpha_agp_info *agp)
|
|||
if (!alpha_agpgart_size)
|
||||
return -ENOMEM;
|
||||
|
||||
aper = kmalloc_obj(struct titan_agp_aperture, GFP_KERNEL);
|
||||
aper = kmalloc_obj(struct titan_agp_aperture);
|
||||
if (aper == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -760,7 +760,7 @@ titan_agp_info(void)
|
|||
/*
|
||||
* Allocate the info structure.
|
||||
*/
|
||||
agp = kmalloc_obj(*agp, GFP_KERNEL);
|
||||
agp = kmalloc_obj(*agp);
|
||||
if (!agp)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ process_reloc_for_got(Elf64_Rela *rela,
|
|||
goto found_entry;
|
||||
}
|
||||
|
||||
g = kmalloc_obj(*g, GFP_KERNEL);
|
||||
g = kmalloc_obj(*g);
|
||||
g->next = chains[r_sym].next;
|
||||
g->r_addend = r_addend;
|
||||
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);
|
||||
chains = kzalloc_objs(struct got_entry, nsyms, GFP_KERNEL);
|
||||
chains = kzalloc_objs(struct got_entry, nsyms);
|
||||
if (!chains) {
|
||||
printk(KERN_ERR
|
||||
"module %s: no memory for symbol chain buffer\n",
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ static void pdev_save_srm_config(struct pci_dev *dev)
|
|||
printed = 1;
|
||||
}
|
||||
|
||||
tmp = kmalloc_obj(*tmp, GFP_KERNEL);
|
||||
tmp = kmalloc_obj(*tmp);
|
||||
if (!tmp) {
|
||||
printk(KERN_ERR "%s: kmalloc() failed!\n", __func__);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ register_cpus(void)
|
|||
int i;
|
||||
|
||||
for_each_possible_cpu(i) {
|
||||
struct cpu *p = kzalloc_obj(*p, GFP_KERNEL);
|
||||
struct cpu *p = kzalloc_obj(*p);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
register_cpu(p, i);
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ void *unwind_add_table(struct module *module, const void *table_start,
|
|||
if (table_size <= 0)
|
||||
return NULL;
|
||||
|
||||
table = kmalloc_obj(*table, GFP_KERNEL);
|
||||
table = kmalloc_obj(*table);
|
||||
if (!table)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -1140,7 +1140,7 @@ static int jit_prepare_final_mem_alloc(struct jit_context *ctx)
|
|||
}
|
||||
|
||||
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)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
|
|||
struct locomo_dev *dev;
|
||||
int ret;
|
||||
|
||||
dev = kzalloc_obj(struct locomo_dev, GFP_KERNEL);
|
||||
dev = kzalloc_obj(struct locomo_dev);
|
||||
if (!dev) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
|
|
@ -277,7 +277,7 @@ static int locomo_suspend(struct platform_device *dev, pm_message_t state)
|
|||
struct locomo_save_data *save;
|
||||
unsigned long flags;
|
||||
|
||||
save = kmalloc_obj(struct locomo_save_data, GFP_KERNEL);
|
||||
save = kmalloc_obj(struct locomo_save_data);
|
||||
if (!save)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
|
|||
unsigned long r;
|
||||
int i, ret = -ENODEV;
|
||||
|
||||
lchip = kzalloc_obj(struct locomo, GFP_KERNEL);
|
||||
lchip = kzalloc_obj(struct locomo);
|
||||
if (!lchip)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -737,7 +737,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
|
|||
unsigned i;
|
||||
int ret;
|
||||
|
||||
dev = kzalloc_obj(struct sa1111_dev, GFP_KERNEL);
|
||||
dev = kzalloc_obj(struct sa1111_dev);
|
||||
if (!dev) {
|
||||
ret = -ENOMEM;
|
||||
goto err_alloc;
|
||||
|
|
@ -969,7 +969,7 @@ static int sa1111_suspend_noirq(struct device *dev)
|
|||
unsigned int val;
|
||||
void __iomem *base;
|
||||
|
||||
save = kmalloc_obj(struct sa1111_save_data, GFP_KERNEL);
|
||||
save = kmalloc_obj(struct sa1111_save_data);
|
||||
if (!save)
|
||||
return -ENOMEM;
|
||||
sachip->saved_state = save;
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ static int scoop_probe(struct platform_device *pdev)
|
|||
if (!mem)
|
||||
return -EINVAL;
|
||||
|
||||
devptr = kzalloc_obj(struct scoop_dev, GFP_KERNEL);
|
||||
devptr = kzalloc_obj(struct scoop_dev);
|
||||
if (!devptr)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ static unsigned long get_arch_pgd(pgd_t *pgd)
|
|||
static int secondary_biglittle_prepare(unsigned int 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ asmlinkage long sys_oabi_semtimedop(int semid,
|
|||
return -E2BIG;
|
||||
if (nsops < 1 || nsops > SEMOPM)
|
||||
return -EINVAL;
|
||||
sops = kvmalloc_objs(*sops, nsops, GFP_KERNEL);
|
||||
sops = kvmalloc_objs(*sops, nsops);
|
||||
if (!sops)
|
||||
return -ENOMEM;
|
||||
err = 0;
|
||||
|
|
|
|||
|
|
@ -574,7 +574,7 @@ struct unwind_table *unwind_table_add(unsigned long start, unsigned long size,
|
|||
unsigned long text_size)
|
||||
{
|
||||
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,
|
||||
text_addr, text_size);
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ static int __init vdso_init(void)
|
|||
text_pages = (vdso_end - vdso_start) >> PAGE_SHIFT;
|
||||
|
||||
/* 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)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ int __init dc21285_setup(int nr, struct pci_sys_data *sys)
|
|||
{
|
||||
struct resource *res;
|
||||
|
||||
res = kzalloc_objs(struct resource, 2, GFP_KERNEL);
|
||||
res = kzalloc_objs(struct resource, 2);
|
||||
if (!res) {
|
||||
printk("out of memory for root bus resources");
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ static int __init ebsa285_leds_init(void)
|
|||
for (i = 0; i < ARRAY_SIZE(ebsa285_leds); i++) {
|
||||
struct ebsa285_led *led;
|
||||
|
||||
led = kzalloc_obj(*led, GFP_KERNEL);
|
||||
led = kzalloc_obj(*led);
|
||||
if (!led)
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -727,7 +727,7 @@ static int __init netwinder_leds_init(void)
|
|||
for (i = 0; i < ARRAY_SIZE(netwinder_leds); i++) {
|
||||
struct netwinder_led *led;
|
||||
|
||||
led = kzalloc_obj(*led, GFP_KERNEL);
|
||||
led = kzalloc_obj(*led);
|
||||
if (!led)
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -477,7 +477,7 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b
|
|||
char *name;
|
||||
int ret;
|
||||
|
||||
pmu_mmdc = kzalloc_obj(*pmu_mmdc, GFP_KERNEL);
|
||||
pmu_mmdc = kzalloc_obj(*pmu_mmdc);
|
||||
if (!pmu_mmdc) {
|
||||
pr_err("failed to allocate PMU device!\n");
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ static void __init i2c_quirk(void)
|
|||
for_each_compatible_node(np, NULL, "marvell,mv78230-i2c") {
|
||||
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->length = sizeof("marvell,mv78230-a0-i2c");
|
||||
|
|
|
|||
|
|
@ -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") {
|
||||
struct property *p;
|
||||
|
||||
p = kzalloc_obj(*p, GFP_KERNEL);
|
||||
p = kzalloc_obj(*p);
|
||||
p->name = kstrdup("arm,io-coherent", GFP_KERNEL);
|
||||
of_add_property(cache_dn, p);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ static int __init mvebu_soc_device(void)
|
|||
if (!is_id_valid)
|
||||
return 0;
|
||||
|
||||
soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL);
|
||||
soc_dev_attr = kzalloc_obj(*soc_dev_attr);
|
||||
if (!soc_dev_attr)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ static void __init mxs_machine_init(void)
|
|||
const u32 *ocotp = mxs_get_ocotp();
|
||||
int ret;
|
||||
|
||||
soc_dev_attr = kzalloc_obj(*soc_dev_attr, GFP_KERNEL);
|
||||
soc_dev_attr = kzalloc_obj(*soc_dev_attr);
|
||||
if (!soc_dev_attr)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ static int __init omap1_system_dma_init(void)
|
|||
goto exit_iounmap;
|
||||
}
|
||||
|
||||
d = kzalloc_obj(*d, GFP_KERNEL);
|
||||
d = kzalloc_obj(*d);
|
||||
if (!d) {
|
||||
ret = -ENOMEM;
|
||||
goto exit_iounmap;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ static int __init omap1_dm_timer_init(void)
|
|||
goto err_free_pdev;
|
||||
}
|
||||
|
||||
pdata = kzalloc_obj(*pdata, GFP_KERNEL);
|
||||
pdata = kzalloc_obj(*pdata);
|
||||
if (!pdata) {
|
||||
ret = -ENOMEM;
|
||||
goto err_free_pdata;
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ void omap2xxx_clkt_vps_init(void)
|
|||
omap2xxx_clkt_vps_late_init();
|
||||
omap2xxx_clkt_vps_check_bootloader_rates();
|
||||
|
||||
hw = kzalloc_obj(*hw, GFP_KERNEL);
|
||||
hw = kzalloc_obj(*hw);
|
||||
if (!hw)
|
||||
return;
|
||||
init.name = "virt_prcm_set";
|
||||
|
|
|
|||
|
|
@ -787,7 +787,7 @@ void __init omap_soc_device_init(void)
|
|||
struct soc_device *soc_dev;
|
||||
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)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ static struct powerdomain *_get_pwrdm(struct device *dev)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
entry = kmalloc_obj(*entry, GFP_KERNEL);
|
||||
entry = kmalloc_obj(*entry);
|
||||
if (entry) {
|
||||
entry->dev = dev;
|
||||
entry->pwrdm = pwrdm;
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
|
|||
!omap_hwmod_parse_module_range(NULL, node, &res))
|
||||
return -ENODEV;
|
||||
|
||||
hwmods = kzalloc_objs(struct omap_hwmod *, oh_cnt, GFP_KERNEL);
|
||||
hwmods = kzalloc_objs(struct omap_hwmod *, oh_cnt);
|
||||
if (!hwmods) {
|
||||
ret = -ENOMEM;
|
||||
goto odbfd_exit;
|
||||
|
|
@ -309,7 +309,7 @@ static struct omap_device *omap_device_alloc(struct platform_device *pdev,
|
|||
int i;
|
||||
struct omap_hwmod **hwmods;
|
||||
|
||||
od = kzalloc_obj(struct omap_device, GFP_KERNEL);
|
||||
od = kzalloc_obj(struct omap_device);
|
||||
if (!od)
|
||||
goto oda_exit1;
|
||||
|
||||
|
|
|
|||
|
|
@ -3392,7 +3392,7 @@ static int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh,
|
|||
void __iomem *regs = NULL;
|
||||
unsigned long flags;
|
||||
|
||||
sysc = kzalloc_obj(*sysc, GFP_KERNEL);
|
||||
sysc = kzalloc_obj(*sysc);
|
||||
if (!sysc)
|
||||
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)) {
|
||||
oi = kzalloc_obj(*oi, GFP_KERNEL);
|
||||
oi = kzalloc_obj(*oi);
|
||||
if (!oi)
|
||||
goto out_free_class;
|
||||
|
||||
|
|
@ -3525,7 +3525,7 @@ int omap_hwmod_init_module(struct device *dev,
|
|||
|
||||
oh = _lookup(data->name);
|
||||
if (!oh) {
|
||||
oh = kzalloc_obj(*oh, GFP_KERNEL);
|
||||
oh = kzalloc_obj(*oh);
|
||||
if (!oh)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -3536,7 +3536,7 @@ int omap_hwmod_init_module(struct device *dev,
|
|||
/* Unused, can be handled by PRM driver handling resets */
|
||||
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) {
|
||||
kfree(oh);
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ static int __init amx3_idle_init(struct device_node *cpu_node, int cpu)
|
|||
state_count++;
|
||||
}
|
||||
|
||||
idle_states = kzalloc_objs(*idle_states, state_count, GFP_KERNEL);
|
||||
idle_states = kzalloc_objs(*idle_states, state_count);
|
||||
if (!idle_states)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ static void __init sr_set_nvalues(struct omap_volt_data *volt_data,
|
|||
while (volt_data[count].volt_nominal)
|
||||
count++;
|
||||
|
||||
nvalue_table = kzalloc_objs(*nvalue_table, count, GFP_KERNEL);
|
||||
nvalue_table = kzalloc_objs(*nvalue_table, count);
|
||||
if (!nvalue_table)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ static int __init pcie_setup(struct pci_sys_data *sys)
|
|||
/*
|
||||
* Request resources.
|
||||
*/
|
||||
res = kzalloc_obj(struct resource, GFP_KERNEL);
|
||||
res = kzalloc_obj(struct resource);
|
||||
if (!res)
|
||||
panic("pcie_setup unable to alloc resources");
|
||||
|
||||
|
|
@ -490,7 +490,7 @@ static int __init pci_setup(struct pci_sys_data *sys)
|
|||
/*
|
||||
* Request resources
|
||||
*/
|
||||
res = kzalloc_obj(struct resource, GFP_KERNEL);
|
||||
res = kzalloc_obj(struct resource);
|
||||
if (!res)
|
||||
panic("pci_setup unable to alloc resources");
|
||||
|
||||
|
|
|
|||
|
|
@ -692,7 +692,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
|
|||
unsigned long base;
|
||||
int i;
|
||||
|
||||
ec = kzalloc_obj(ecard_t, GFP_KERNEL);
|
||||
ec = kzalloc_obj(ecard_t);
|
||||
if (!ec) {
|
||||
ec = ERR_PTR(-ENOMEM);
|
||||
goto nomem;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ int __init sa11xx_clk_init(void)
|
|||
|
||||
clk_hw_register_clkdev(hw, "OSTIMER0", NULL);
|
||||
|
||||
hw = kzalloc_obj(*hw, GFP_KERNEL);
|
||||
hw = kzalloc_obj(*hw);
|
||||
if (!hw)
|
||||
return -ENOMEM;
|
||||
hw->init = &clk_mpll_init_data;
|
||||
|
|
@ -129,7 +129,7 @@ int __init sa11xx_clk_init(void)
|
|||
FAlnMsk(TUCR_TSEL), 0, &tucr_lock);
|
||||
clk_set_rate(hw->clk, 3686400);
|
||||
|
||||
hw = kzalloc_obj(*hw, GFP_KERNEL);
|
||||
hw = kzalloc_obj(*hw);
|
||||
if (!hw)
|
||||
return -ENOMEM;
|
||||
hw->init = &clk_gpio27_init_data;
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ int __init sa11x0_register_fixed_regulator(int n,
|
|||
{
|
||||
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)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ static int neponset_probe(struct platform_device *dev)
|
|||
goto err_alloc;
|
||||
}
|
||||
|
||||
d = kzalloc_obj(*d, GFP_KERNEL);
|
||||
d = kzalloc_obj(*d);
|
||||
if (!d) {
|
||||
ret = -ENOMEM;
|
||||
goto err_alloc;
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ static int __init rcar_gen2_regulator_quirk(void)
|
|||
if (ret) /* Skip invalid entry and continue */
|
||||
continue;
|
||||
|
||||
quirk = kzalloc_obj(*quirk, GFP_KERNEL);
|
||||
quirk = kzalloc_obj(*quirk);
|
||||
if (!quirk) {
|
||||
ret = -ENOMEM;
|
||||
of_node_put(np);
|
||||
|
|
|
|||
|
|
@ -395,7 +395,7 @@ static int ve_spc_populate_opps(uint32_t cluster)
|
|||
uint32_t data = 0, off, ret, idx;
|
||||
struct ve_spc_opp *opps;
|
||||
|
||||
opps = kzalloc_objs(*opps, MAX_OPPS, GFP_KERNEL);
|
||||
opps = kzalloc_objs(*opps, MAX_OPPS);
|
||||
if (!opps)
|
||||
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 ret;
|
||||
info = kzalloc_obj(*info, GFP_KERNEL);
|
||||
info = kzalloc_obj(*info);
|
||||
if (!info)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -525,7 +525,7 @@ static struct clk *ve_spc_clk_register(struct device *cpu_dev)
|
|||
struct clk_init_data init;
|
||||
struct clk_spc *spc;
|
||||
|
||||
spc = kzalloc_obj(*spc, GFP_KERNEL);
|
||||
spc = kzalloc_obj(*spc);
|
||||
if (!spc)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ static void __init versatile_dt_pci_init(void)
|
|||
goto out_put_node;
|
||||
}
|
||||
|
||||
newprop = kzalloc_obj(*newprop, GFP_KERNEL);
|
||||
newprop = kzalloc_obj(*newprop);
|
||||
if (!newprop)
|
||||
goto out_put_node;
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ static void __init zynq_init_machine(void)
|
|||
struct soc_device *soc_dev;
|
||||
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)
|
||||
goto out;
|
||||
|
||||
|
|
|
|||
|
|
@ -507,7 +507,7 @@ static __init int l2x0_pmu_init(void)
|
|||
if (!l2x0_base)
|
||||
return 0;
|
||||
|
||||
l2x0_pmu = kzalloc_obj(*l2x0_pmu, GFP_KERNEL);
|
||||
l2x0_pmu = kzalloc_obj(*l2x0_pmu);
|
||||
if (!l2x0_pmu) {
|
||||
pr_warn("Unable to allocate L2x0 PMU\n");
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ static int __init __uniphier_cache_init(struct device_node *np,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
data = kzalloc_obj(*data, GFP_KERNEL);
|
||||
data = kzalloc_obj(*data);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -1504,7 +1504,7 @@ arm_iommu_create_mapping(struct device *dev, dma_addr_t base, u64 size)
|
|||
bitmap_size = PAGE_SIZE;
|
||||
}
|
||||
|
||||
mapping = kzalloc_obj(struct dma_iommu_mapping, GFP_KERNEL);
|
||||
mapping = kzalloc_obj(struct dma_iommu_mapping);
|
||||
if (!mapping)
|
||||
goto err;
|
||||
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ int __init arch_xen_unpopulated_init(struct resource **res)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
regs = kzalloc_objs(*regs, nr_reg, GFP_KERNEL);
|
||||
regs = kzalloc_objs(*regs, nr_reg);
|
||||
if (!regs) {
|
||||
of_node_put(np);
|
||||
return -ENOMEM;
|
||||
|
|
@ -383,7 +383,7 @@ int __init arch_xen_unpopulated_init(struct resource **res)
|
|||
start = regs[i - 1].end + 1;
|
||||
end = regs[i].start - 1;
|
||||
|
||||
tmp_res = kzalloc_obj(*tmp_res, GFP_KERNEL);
|
||||
tmp_res = kzalloc_obj(*tmp_res);
|
||||
if (!tmp_res) {
|
||||
rc = -ENOMEM;
|
||||
goto err;
|
||||
|
|
|
|||
|
|
@ -487,7 +487,7 @@ static int share_pfn_hyp(u64 pfn)
|
|||
goto unlock;
|
||||
}
|
||||
|
||||
this = kzalloc_obj(*this, GFP_KERNEL);
|
||||
this = kzalloc_obj(*this);
|
||||
if (!this) {
|
||||
ret = -ENOMEM;
|
||||
goto unlock;
|
||||
|
|
@ -2329,7 +2329,7 @@ int __init kvm_mmu_init(u32 hyp_va_bits)
|
|||
goto out;
|
||||
}
|
||||
|
||||
hyp_pgtable = kzalloc_obj(*hyp_pgtable, GFP_KERNEL);
|
||||
hyp_pgtable = kzalloc_obj(*hyp_pgtable);
|
||||
if (!hyp_pgtable) {
|
||||
kvm_err("Hyp mode page-table not allocated\n");
|
||||
err = -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -797,7 +797,7 @@ void kvm_host_pmu_init(struct arm_pmu *pmu)
|
|||
|
||||
guard(mutex)(&arm_pmus_lock);
|
||||
|
||||
entry = kmalloc_obj(*entry, GFP_KERNEL);
|
||||
entry = kmalloc_obj(*entry);
|
||||
if (!entry)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ static void *vgic_debug_start(struct seq_file *s, loff_t *pos)
|
|||
struct kvm *kvm = s->private;
|
||||
struct vgic_state_iter *iter;
|
||||
|
||||
iter = kmalloc_obj(*iter, GFP_KERNEL);
|
||||
iter = kmalloc_obj(*iter);
|
||||
if (!iter)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
@ -375,7 +375,7 @@ static void *vgic_its_debug_start(struct seq_file *s, loff_t *pos)
|
|||
if (!dev)
|
||||
return NULL;
|
||||
|
||||
iter = kmalloc_obj(*iter, GFP_KERNEL);
|
||||
iter = kmalloc_obj(*iter);
|
||||
if (!iter)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
|
|||
|
|
@ -654,7 +654,7 @@ static struct gic_kvm_info *gic_kvm_info;
|
|||
void __init vgic_set_kvm_info(const struct gic_kvm_info *info)
|
||||
{
|
||||
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)
|
||||
*gic_kvm_info = *info;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2040,7 +2040,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
|
|||
|
||||
jit_data = prog->aux->jit_data;
|
||||
if (!jit_data) {
|
||||
jit_data = kzalloc_obj(*jit_data, GFP_KERNEL);
|
||||
jit_data = kzalloc_obj(*jit_data);
|
||||
if (!jit_data) {
|
||||
prog = orig_prog;
|
||||
goto out;
|
||||
|
|
@ -2078,7 +2078,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
|
|||
memset(&ctx, 0, sizeof(ctx));
|
||||
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) {
|
||||
prog = orig_prog;
|
||||
goto out_off;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ static int __init vdso_init(void)
|
|||
|
||||
vdso_pages = (vdso_end - vdso_start) >> PAGE_SHIFT;
|
||||
vdso_pagelist =
|
||||
kzalloc_objs(struct page *, vdso_pages, GFP_KERNEL);
|
||||
kzalloc_objs(struct page *, vdso_pages);
|
||||
if (unlikely(vdso_pagelist == NULL)) {
|
||||
pr_err("vdso: pagelist allocation failed\n");
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -622,7 +622,7 @@ static int kvm_eiointc_create(struct kvm_device *dev, u32 type)
|
|||
if (kvm->arch.eiointc)
|
||||
return -EINVAL;
|
||||
|
||||
s = kzalloc_obj(struct loongarch_eiointc, GFP_KERNEL);
|
||||
s = kzalloc_obj(struct loongarch_eiointc);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ static int kvm_ipi_create(struct kvm_device *dev, u32 type)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
s = kzalloc_obj(struct loongarch_ipi, GFP_KERNEL);
|
||||
s = kzalloc_obj(struct loongarch_ipi);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ static int kvm_setup_default_irq_routing(struct kvm *kvm)
|
|||
u32 nr = KVM_IRQCHIP_NUM_PINS;
|
||||
struct kvm_irq_routing_entry *entries;
|
||||
|
||||
entries = kzalloc_objs(*entries, nr, GFP_KERNEL);
|
||||
entries = kzalloc_objs(*entries, nr);
|
||||
if (!entries)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -432,7 +432,7 @@ static int kvm_pch_pic_create(struct kvm_device *dev, u32 type)
|
|||
if (ret)
|
||||
return -ENOMEM;
|
||||
|
||||
s = kzalloc_obj(struct loongarch_pch_pic, GFP_KERNEL);
|
||||
s = kzalloc_obj(struct loongarch_pch_pic);
|
||||
if (!s)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ static int kvm_loongarch_env_init(void)
|
|||
return -ENOMEM;
|
||||
}
|
||||
|
||||
kvm_loongarch_ops = kzalloc_obj(*kvm_loongarch_ops, GFP_KERNEL);
|
||||
kvm_loongarch_ops = kzalloc_obj(*kvm_loongarch_ops);
|
||||
if (!kvm_loongarch_ops) {
|
||||
free_percpu(vmcs);
|
||||
vmcs = NULL;
|
||||
|
|
|
|||
|
|
@ -1547,7 +1547,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
|
|||
|
||||
vcpu->arch.handle_exit = kvm_handle_exit;
|
||||
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)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -1943,7 +1943,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
|
|||
|
||||
jit_data = prog->aux->jit_data;
|
||||
if (!jit_data) {
|
||||
jit_data = kzalloc_obj(*jit_data, GFP_KERNEL);
|
||||
jit_data = kzalloc_obj(*jit_data);
|
||||
if (!jit_data) {
|
||||
prog = orig_prog;
|
||||
goto out;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ static struct pci_config_window *arch_pci_ecam_create(struct device *dev,
|
|||
if (busr->start > busr->end)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
cfg = kzalloc_obj(*cfg, GFP_KERNEL);
|
||||
cfg = kzalloc_obj(*cfg);
|
||||
if (!cfg)
|
||||
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 busnum = root->secondary.start;
|
||||
|
||||
info = kzalloc_obj(*info, GFP_KERNEL);
|
||||
info = kzalloc_obj(*info);
|
||||
if (!info) {
|
||||
pr_warn("pci_bus %04x:%02x: ignored (out of memory)\n", domain, busnum);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
root_ops = kzalloc_obj(*root_ops, GFP_KERNEL);
|
||||
root_ops = kzalloc_obj(*root_ops);
|
||||
if (!root_ops) {
|
||||
kfree(info);
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ void *amiga_chip_alloc(unsigned long size, const char *name)
|
|||
struct resource *res;
|
||||
void *p;
|
||||
|
||||
res = kzalloc_obj(struct resource, GFP_KERNEL);
|
||||
res = kzalloc_obj(struct resource);
|
||||
if (!res)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ void *atari_stram_alloc(unsigned long size, const char *owner)
|
|||
/* round up */
|
||||
size = PAGE_ALIGN(size);
|
||||
|
||||
res = kzalloc_obj(struct resource, GFP_KERNEL);
|
||||
res = kzalloc_obj(struct resource);
|
||||
if (!res)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
dev = kmalloc_obj(struct nfhd_device, GFP_KERNEL);
|
||||
dev = kmalloc_obj(struct nfhd_device);
|
||||
if (!dev)
|
||||
goto out;
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ static struct vm_struct *get_io_area(unsigned long size)
|
|||
unsigned long addr;
|
||||
struct vm_struct **p, *tmp, *area;
|
||||
|
||||
area = kmalloc_obj(*area, GFP_KERNEL);
|
||||
area = kmalloc_obj(*area);
|
||||
if (!area)
|
||||
return NULL;
|
||||
addr = KMAP_START;
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ static struct clk __init *alchemy_clk_setup_cpu(const char *parent_name,
|
|||
struct clk_hw *h;
|
||||
struct clk *clk;
|
||||
|
||||
h = kzalloc_obj(*h, GFP_KERNEL);
|
||||
h = kzalloc_obj(*h);
|
||||
if (!h)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
@ -249,7 +249,7 @@ static struct clk __init *alchemy_clk_setup_aux(const char *parent_name,
|
|||
struct clk *c;
|
||||
struct alchemy_auxpll_clk *a;
|
||||
|
||||
a = kzalloc_obj(*a, GFP_KERNEL);
|
||||
a = kzalloc_obj(*a);
|
||||
if (!a)
|
||||
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;
|
||||
|
||||
a = kzalloc_objs(*a, 6, GFP_KERNEL);
|
||||
a = kzalloc_objs(*a, 6);
|
||||
if (!a)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -996,7 +996,7 @@ static int __init alchemy_clk_setup_imux(int ctype)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
a = kzalloc_objs(*a, 6, GFP_KERNEL);
|
||||
a = kzalloc_objs(*a, 6);
|
||||
if (!a)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -1057,7 +1057,7 @@ static int __init dbdma_setup(unsigned int irq, dbdev_tab_t *idtable)
|
|||
{
|
||||
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)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -202,10 +202,10 @@ static unsigned long alchemy_ehci_data[][2] __initdata = {
|
|||
|
||||
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)
|
||||
return -ENOMEM;
|
||||
*d = kzalloc_obj(struct platform_device, GFP_KERNEL);
|
||||
*d = kzalloc_obj(struct platform_device);
|
||||
if (!*d) {
|
||||
kfree(*r);
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ int __init db1x_register_pcmcia_socket(phys_addr_t pcmcia_attr_start,
|
|||
if (stschg_irq)
|
||||
cnt++;
|
||||
|
||||
sr = kzalloc_objs(struct resource, cnt, GFP_KERNEL);
|
||||
sr = kzalloc_objs(struct resource, cnt);
|
||||
if (!sr)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -162,15 +162,15 @@ int __init db1x_register_norflash(unsigned long size, int width,
|
|||
return -EINVAL;
|
||||
|
||||
ret = -ENOMEM;
|
||||
parts = kzalloc_objs(struct mtd_partition, 5, GFP_KERNEL);
|
||||
parts = kzalloc_objs(struct mtd_partition, 5);
|
||||
if (!parts)
|
||||
goto out;
|
||||
|
||||
res = kzalloc_obj(struct resource, GFP_KERNEL);
|
||||
res = kzalloc_obj(struct resource);
|
||||
if (!res)
|
||||
goto out1;
|
||||
|
||||
pfd = kzalloc_obj(struct physmap_flash_data, GFP_KERNEL);
|
||||
pfd = kzalloc_obj(struct physmap_flash_data);
|
||||
if (!pfd)
|
||||
goto out2;
|
||||
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ static struct device * __init bcm47xx_setup_device(void)
|
|||
struct device *dev;
|
||||
int err;
|
||||
|
||||
dev = kzalloc_obj(*dev, GFP_KERNEL);
|
||||
dev = kzalloc_obj(*dev);
|
||||
if (!dev)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
cd = kzalloc_obj(*cd, GFP_KERNEL);
|
||||
cd = kzalloc_obj(*cd);
|
||||
if (!cd)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -1462,7 +1462,7 @@ static int __init octeon_irq_init_ciu(
|
|||
struct irq_domain *ciu_domain = NULL;
|
||||
struct octeon_irq_ciu_domain_data *dd;
|
||||
|
||||
dd = kzalloc_obj(*dd, GFP_KERNEL);
|
||||
dd = kzalloc_obj(*dd);
|
||||
if (!dd)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -1633,7 +1633,7 @@ static int __init octeon_irq_init_gpio(
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
gpiod = kzalloc_obj(*gpiod, GFP_KERNEL);
|
||||
gpiod = kzalloc_obj(*gpiod);
|
||||
if (gpiod) {
|
||||
/* gpio domain host_data is the base hwirq number. */
|
||||
gpiod->base_hwirq = base_hwirq;
|
||||
|
|
@ -2223,7 +2223,7 @@ static int octeon_irq_cib_map(struct irq_domain *d,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
cd = kzalloc_obj(*cd, GFP_KERNEL);
|
||||
cd = kzalloc_obj(*cd);
|
||||
if (!cd)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -2304,7 +2304,7 @@ static int __init octeon_irq_init_cib(struct device_node *ciu_node,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
host_data = kzalloc_obj(*host_data, GFP_KERNEL);
|
||||
host_data = kzalloc_obj(*host_data);
|
||||
if (!host_data)
|
||||
return -ENOMEM;
|
||||
raw_spin_lock_init(&host_data->lock);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
* actual relocation.
|
||||
*/
|
||||
n = kmalloc_obj(*n, GFP_KERNEL);
|
||||
n = kmalloc_obj(*n);
|
||||
if (!n)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
|
|||
for (cl = 0; cl < nclusters; cl++) {
|
||||
/* Allocate core boot configuration structs */
|
||||
ncores = mips_cps_numcores(cl);
|
||||
core_bootcfg = kzalloc_objs(*core_bootcfg, ncores, GFP_KERNEL);
|
||||
core_bootcfg = kzalloc_objs(*core_bootcfg, ncores);
|
||||
if (!core_bootcfg)
|
||||
goto err_out;
|
||||
mips_cps_cluster_bootcfg[cl].core_config = core_bootcfg;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ struct vpe *alloc_vpe(int minor)
|
|||
{
|
||||
struct vpe *v;
|
||||
|
||||
v = kzalloc_obj(struct vpe, GFP_KERNEL);
|
||||
v = kzalloc_obj(struct vpe);
|
||||
if (v == NULL)
|
||||
goto out;
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ struct tc *alloc_tc(int index)
|
|||
{
|
||||
struct tc *tc;
|
||||
|
||||
tc = kzalloc_obj(struct tc, GFP_KERNEL);
|
||||
tc = kzalloc_obj(struct tc);
|
||||
if (tc == NULL)
|
||||
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
|
||||
* actual relocation.
|
||||
*/
|
||||
n = kmalloc_obj(*n, GFP_KERNEL);
|
||||
n = kmalloc_obj(*n);
|
||||
if (!n)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ static void falcon_gpe_enable(void)
|
|||
static inline void clkdev_add_sys(const char *dev, unsigned int module,
|
||||
unsigned int bits)
|
||||
{
|
||||
struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL);
|
||||
struct clk *clk = kzalloc_obj(struct clk);
|
||||
|
||||
if (!clk)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ static void gptu_disable(struct clk *clk)
|
|||
static inline void clkdev_add_gptu(struct device *dev, const char *con,
|
||||
unsigned int timer)
|
||||
{
|
||||
struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL);
|
||||
struct clk *clk = kzalloc_obj(struct clk);
|
||||
|
||||
if (!clk)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ static int clkout_enable(struct clk *clk)
|
|||
static void clkdev_add_pmu(const char *dev, const char *con, bool deactivate,
|
||||
unsigned int module, unsigned int bits)
|
||||
{
|
||||
struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL);
|
||||
struct clk *clk = kzalloc_obj(struct clk);
|
||||
|
||||
if (!clk)
|
||||
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,
|
||||
unsigned int bits)
|
||||
{
|
||||
struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL);
|
||||
struct clk *clk = kzalloc_obj(struct clk);
|
||||
|
||||
if (!clk)
|
||||
return;
|
||||
|
|
@ -374,8 +374,8 @@ static unsigned long valid_pci_rates[] = {CLOCK_33M, CLOCK_62_5M, 0};
|
|||
|
||||
static void clkdev_add_pci(void)
|
||||
{
|
||||
struct clk *clk = kzalloc_obj(struct clk, GFP_KERNEL);
|
||||
struct clk *clk_ext = kzalloc_obj(struct clk, GFP_KERNEL);
|
||||
struct clk *clk = kzalloc_obj(struct clk);
|
||||
struct clk *clk_ext = kzalloc_obj(struct clk);
|
||||
|
||||
/* main pci clock */
|
||||
if (clk) {
|
||||
|
|
@ -423,7 +423,7 @@ static void clkdev_add_clkout(void)
|
|||
continue;
|
||||
sprintf(name, "clkout%d", i);
|
||||
|
||||
clk = kzalloc_obj(struct clk, GFP_KERNEL);
|
||||
clk = kzalloc_obj(struct clk);
|
||||
if (!clk) {
|
||||
kfree(name);
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@ static int alchemy_pci_probe(struct platform_device *pdev)
|
|||
goto out;
|
||||
}
|
||||
|
||||
ctx = kzalloc_obj(*ctx, GFP_KERNEL);
|
||||
ctx = kzalloc_obj(*ctx);
|
||||
if (!ctx) {
|
||||
dev_err(&pdev->dev, "no memory for pcictl context\n");
|
||||
ret = -ENOMEM;
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ static int bridge_domain_alloc(struct irq_domain *domain, unsigned int virq,
|
|||
if (nr_irqs > 1 || !info)
|
||||
return -EINVAL;
|
||||
|
||||
data = kzalloc_obj(*data, GFP_KERNEL);
|
||||
data = kzalloc_obj(*data);
|
||||
if (!data)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ static int __init mt7620_soc_dev_init(void)
|
|||
struct soc_device *soc_dev;
|
||||
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)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ static int __init mt7621_soc_dev_init(void)
|
|||
struct soc_device *soc_dev;
|
||||
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)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ static int __init rt2880_soc_dev_init(void)
|
|||
struct soc_device *soc_dev;
|
||||
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)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ static int __init rt305x_soc_dev_init(void)
|
|||
struct soc_device *soc_dev;
|
||||
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)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ static int __init rt3883_soc_dev_init(void)
|
|||
struct soc_device *soc_dev;
|
||||
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)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
slotno, name, id);
|
||||
gio_dev = kzalloc_obj(*gio_dev, GFP_KERNEL);
|
||||
gio_dev = kzalloc_obj(*gio_dev);
|
||||
if (!gio_dev)
|
||||
return;
|
||||
gio_dev->name = name;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ static int hub_domain_alloc(struct irq_domain *domain, unsigned int virq,
|
|||
if (nr_irqs > 1 || !info)
|
||||
return -EINVAL;
|
||||
|
||||
hd = kzalloc_obj(*hd, GFP_KERNEL);
|
||||
hd = kzalloc_obj(*hd);
|
||||
if (!hd)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ static void bridge_platform_create(nasid_t nasid, int widget, int masterwid)
|
|||
|
||||
offset = NODE_OFFSET(nasid);
|
||||
|
||||
wd = kzalloc_obj(*wd, GFP_KERNEL);
|
||||
wd = kzalloc_obj(*wd);
|
||||
if (!wd) {
|
||||
pr_warn("xtalk:n%d/%x bridge create out of memory\n", nasid, widget);
|
||||
return;
|
||||
|
|
@ -69,7 +69,7 @@ static void bridge_platform_create(nasid_t nasid, int widget, int masterwid)
|
|||
/* platform_device_add_data() duplicates the data */
|
||||
kfree(wd);
|
||||
|
||||
bd = kzalloc_obj(*bd, GFP_KERNEL);
|
||||
bd = kzalloc_obj(*bd);
|
||||
if (!bd) {
|
||||
pr_warn("xtalk:n%d/%x bridge create out of memory\n", nasid, widget);
|
||||
goto err_unregister_pdev_wd;
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ static int heart_domain_alloc(struct irq_domain *domain, unsigned int virq,
|
|||
if (nr_irqs > 1 || !info)
|
||||
return -EINVAL;
|
||||
|
||||
hd = kzalloc_obj(*hd, GFP_KERNEL);
|
||||
hd = kzalloc_obj(*hd);
|
||||
if (!hd)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ static void bridge_platform_create(int widget, int masterwid)
|
|||
struct platform_device *pdev_bd;
|
||||
struct resource w1_res;
|
||||
|
||||
wd = kzalloc_obj(*wd, GFP_KERNEL);
|
||||
wd = kzalloc_obj(*wd);
|
||||
if (!wd) {
|
||||
pr_warn("xtalk:%x bridge create out of memory\n", widget);
|
||||
return;
|
||||
|
|
@ -79,7 +79,7 @@ static void bridge_platform_create(int widget, int masterwid)
|
|||
/* platform_device_add_data() duplicates the data */
|
||||
kfree(wd);
|
||||
|
||||
bd = kzalloc_obj(*bd, GFP_KERNEL);
|
||||
bd = kzalloc_obj(*bd);
|
||||
if (!bd) {
|
||||
pr_warn("xtalk:%x bridge create out of memory\n", widget);
|
||||
goto err_unregister_pdev_wd;
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ txx9_alloc_pci_controller(struct pci_controller *pcic,
|
|||
int min_size = 0x10000;
|
||||
|
||||
if (!pcic) {
|
||||
new = kzalloc_obj(*new, GFP_KERNEL);
|
||||
new = kzalloc_obj(*new);
|
||||
if (!new)
|
||||
return NULL;
|
||||
new->r_mem[0].name = "PCI mem";
|
||||
|
|
|
|||
|
|
@ -648,7 +648,7 @@ void __init txx9_iocled_init(unsigned long baseaddr,
|
|||
|
||||
if (!deftriggers)
|
||||
deftriggers = default_triggers;
|
||||
iocled = kzalloc_obj(*iocled, GFP_KERNEL);
|
||||
iocled = kzalloc_obj(*iocled);
|
||||
if (!iocled)
|
||||
return;
|
||||
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);
|
||||
if (err)
|
||||
return;
|
||||
dev = kzalloc_obj(*dev, GFP_KERNEL);
|
||||
dev = kzalloc_obj(*dev);
|
||||
if (!dev)
|
||||
return;
|
||||
size = resource_size(r);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ static int __init nios2_soc_device_init(void)
|
|||
struct soc_device_attribute *soc_dev_attr;
|
||||
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) {
|
||||
machine = of_flat_dt_get_machine_name();
|
||||
if (machine)
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ static void setup_bus_id(struct parisc_device *padev)
|
|||
static struct parisc_device * __init create_tree_node(char id,
|
||||
struct device *parent)
|
||||
{
|
||||
struct parisc_device *dev = kzalloc_obj(*dev, GFP_KERNEL);
|
||||
struct parisc_device *dev = kzalloc_obj(*dev);
|
||||
if (!dev)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ pat_query_module(ulong pcell_loc, ulong mod_index)
|
|||
long status; /* PDC return value status */
|
||||
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)
|
||||
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;
|
||||
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) {
|
||||
printk(KERN_ERR "%s %s(): memory allocation failure\n",
|
||||
__FILE__, __func__);
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ static int __init processor_probe(struct parisc_device *dev)
|
|||
unsigned long bytecnt;
|
||||
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)
|
||||
panic("couldn't allocate memory for PDC_PAT_CELL!");
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ static struct page ** __init vdso_setup_pages(void *start, void *end)
|
|||
struct page **pagelist;
|
||||
int i;
|
||||
|
||||
pagelist = kzalloc_objs(struct page *, pages + 1, GFP_KERNEL);
|
||||
pagelist = kzalloc_objs(struct page *, pages + 1);
|
||||
if (!pagelist)
|
||||
panic("%s: Cannot allocate page list for VDSO", __func__);
|
||||
for (i = 0; i < pages; i++)
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
|
|||
|
||||
jit_data = prog->aux->jit_data;
|
||||
if (!jit_data) {
|
||||
jit_data = kzalloc_obj(*jit_data, GFP_KERNEL);
|
||||
jit_data = kzalloc_obj(*jit_data);
|
||||
if (!jit_data) {
|
||||
prog = orig_prog;
|
||||
goto out;
|
||||
|
|
@ -80,7 +80,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
|
|||
}
|
||||
|
||||
ctx->prog = prog;
|
||||
ctx->offset = kzalloc_objs(int, prog->len, GFP_KERNEL);
|
||||
ctx->offset = kzalloc_objs(int, prog->len);
|
||||
if (!ctx->offset) {
|
||||
prog = orig_prog;
|
||||
goto out_offset;
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ static struct cache *new_cache(int type, int level,
|
|||
{
|
||||
struct cache *cache;
|
||||
|
||||
cache = kzalloc_obj(*cache, GFP_KERNEL);
|
||||
cache = kzalloc_obj(*cache);
|
||||
if (cache)
|
||||
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)
|
||||
goto err;
|
||||
|
||||
cache_dir = kzalloc_obj(*cache_dir, GFP_KERNEL);
|
||||
cache_dir = kzalloc_obj(*cache_dir);
|
||||
if (!cache_dir)
|
||||
goto err;
|
||||
|
||||
|
|
@ -788,7 +788,7 @@ static void cacheinfo_create_index_dir(struct cache *cache, int index,
|
|||
struct cache_index_dir *index_dir;
|
||||
int rc;
|
||||
|
||||
index_dir = kzalloc_obj(*index_dir, GFP_KERNEL);
|
||||
index_dir = kzalloc_obj(*index_dir);
|
||||
if (!index_dir)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -890,7 +890,7 @@ loff_t __init nvram_create_partition(const char *name, int sig,
|
|||
return -ENOSPC;
|
||||
|
||||
/* Create our OS partition */
|
||||
new_part = kzalloc_obj(*new_part, GFP_KERNEL);
|
||||
new_part = kzalloc_obj(*new_part);
|
||||
if (!new_part) {
|
||||
pr_err("%s: kmalloc failed\n", __func__);
|
||||
return -ENOMEM;
|
||||
|
|
@ -1030,7 +1030,7 @@ int __init nvram_scan_partitions(void)
|
|||
"detected: 0-length partition\n");
|
||||
goto out;
|
||||
}
|
||||
tmp_part = kmalloc_obj(*tmp_part, GFP_KERNEL);
|
||||
tmp_part = kmalloc_obj(*tmp_part);
|
||||
err = -ENOMEM;
|
||||
if (!tmp_part) {
|
||||
printk(KERN_ERR "nvram_scan_partitions: kmalloc failed\n");
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
|
|||
{
|
||||
struct pci_controller *phb;
|
||||
|
||||
phb = kzalloc_obj(struct pci_controller, GFP_KERNEL);
|
||||
phb = kzalloc_obj(struct pci_controller);
|
||||
if (phb == NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -432,7 +432,7 @@ static int pci_read_irq_line(struct pci_dev *pci_dev)
|
|||
struct pci_intx_virq *vi, *vitmp;
|
||||
|
||||
/* 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)
|
||||
return -1;
|
||||
|
||||
|
|
@ -1368,7 +1368,7 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus)
|
|||
if (!(hose->io_resource.flags & IORESOURCE_IO))
|
||||
goto no_io;
|
||||
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);
|
||||
res->name = "Legacy IO";
|
||||
res->flags = IORESOURCE_IO;
|
||||
|
|
@ -1396,7 +1396,7 @@ static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus)
|
|||
}
|
||||
if (i >= 3)
|
||||
return;
|
||||
res = kzalloc_obj(struct resource, GFP_KERNEL);
|
||||
res = kzalloc_obj(struct resource);
|
||||
BUG_ON(res == NULL);
|
||||
res->name = "Legacy VGA memory";
|
||||
res->flags = IORESOURCE_MEM;
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ static struct eeh_dev *eeh_dev_init(struct pci_dn *pdn)
|
|||
struct eeh_dev *edev;
|
||||
|
||||
/* Allocate EEH device */
|
||||
edev = kzalloc_obj(*edev, GFP_KERNEL);
|
||||
edev = kzalloc_obj(*edev);
|
||||
if (!edev)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ static struct pci_dn *add_one_sriov_vf_pdn(struct pci_dn *parent,
|
|||
if (!parent)
|
||||
return NULL;
|
||||
|
||||
pdn = kzalloc_obj(*pdn, GFP_KERNEL);
|
||||
pdn = kzalloc_obj(*pdn);
|
||||
if (!pdn)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -290,7 +290,7 @@ struct pci_dn *pci_add_device_node_info(struct pci_controller *hose,
|
|||
struct eeh_dev *edev;
|
||||
#endif
|
||||
|
||||
pdn = kzalloc_obj(*pdn, GFP_KERNEL);
|
||||
pdn = kzalloc_obj(*pdn);
|
||||
if (pdn == NULL)
|
||||
return NULL;
|
||||
dn->data = pdn;
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ static __init int add_var(const char *name)
|
|||
struct kobject *kobj;
|
||||
int rc;
|
||||
|
||||
kobj = kzalloc_obj(*kobj, GFP_KERNEL);
|
||||
kobj = kzalloc_obj(*kobj);
|
||||
if (!kobj)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ void smp_generic_give_timebase(void)
|
|||
pr_debug("Software timebase sync\n");
|
||||
|
||||
/* if this fails then this kernel won't work anyway... */
|
||||
tbsync = kzalloc_obj(*tbsync, GFP_KERNEL);
|
||||
tbsync = kzalloc_obj(*tbsync);
|
||||
mb();
|
||||
running = 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
* 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)
|
||||
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
Loading…
Add table
Add a link
Reference in a new issue